Thursday, 15 August 2013

c# - How to handle exception if Entity DB file is not found -


I am using Antiti FY with SQL Server Compact database. The problem is, I do not understand how and how to handle the system. Data.EntityException If you do not have a database file, because when I start my application I "Kkagr stopped working" window pops up with the following details

  Problem signature: problem name: CLR20r3 problem signature 01: AVIOB1BUUW4KTDA4Y2PQRQUMWZFODHST problem signature 02: 1.0.0.0 problem signature 03: 5151de5d problem signature 04: System.Data.SqlServerCe problem signature 05: 4.0.8876.1 problem signature 06: 4fcd17f1 problem signature 07: 17b S Msya Signature 08: 4ad Problem signature 09: System.Data.EntityException   

Also, I'm not running it may not seem debug applications VS2012, because of error, so I find it dB File had to be manually renamed by renaming the name

how and Where to handle this exception?

something like:

  if (! File.Exists (NameAndLocationofDBFi Le)} {System.Windows.Forms.MessageBox.Show ("database file does not exist"); Return; // present application}    

iphone - iOS, using underscore vs using iVar directly -


It has been said a lot, but the question is when will you use each of these methods. Please use other than Setter and Gator endless loop

example

.h -
@property (nanatomic, strong) NSMutableArray * mutArray .m -
@synthesize mutArray = _mutArray;

1) Do I want to:
_mutArray = [[NSMUTABELARROL] IITIT]; or OR << CODE> Self.mutArray = [[NSMutableArray alloc] init];
Why would I do each of them, and what's the difference?

2) If I want to add an object to it ...
[_ mutArray addObject: object]; or OK [self.mutArray addobject: object];

And why ?! Thank you very much!

You can only type your code with init and Dealloc or the implementation details (such as inside the accessor, or exactly where you actually need a memory address). In addition to those places, you should always use the accelerator, which means instead of [foo] is _foo .

self.foo Actually, the actual call is about syntactic sugar, which is [self foo] It is important to understand that Self.foo is a standard ObjC messaging, and this means that the same thing as [self foo] . From the conference, you should only use dot-syntax when referring properties.

The direct use of the pre-ARC, the iver was the # 1 cause of crashing in my experience. When specifying an Ever without ARC, you are less likely to reach 100% on the scope of the program.

Since ARC, I still argue that you should always use the accessories (with the above exceptions)), but the reasons are more subtle, the main reason is that an accelerator is customized Can be either in the existing class, sub-class, or through KVO (which is outside of your code). If you reach straight ivar, you will bypass it. For example, it is to say that the property is weak (which is very common). Then if you use EVER before making it, you will get a micro bug. So you should remember, for that property, always use the accelerator. Similarly, you can call setNeedsDisplay or post a notification or like < P> If you have a simple rule that says, "I always use the accessories" then the code is easy to see and it's right. In some cases you need to circumvent the accessor, _ says "Hey, here's the note, I'm doing something weird."

If you have the rule "I use users for those properties that need it, but not for those people" who do not see the code and it's right that it's right. Did the previous developer use Ivar because it was needed or just because he felt it? Can you change it or not? It is very hard to know

Using archives, even after ARC there is also good defensive programming and I highly recommend it.

python - Using one form for two similar models -


मेरे पास निम्न मॉडल हैं:

  वर्ग BaseAddress (models.Model): name = models.CharField (MAX_LENGTH = 100) BUSINESS_NAME = models.CharField (MAX_LENGTH = 100, खाली = सच, अशक्त = सच) पता = models.CharField (MAX_LENGTH = 100, खाली = सच, अशक्त = सच) address_2 = models.CharField ( शहर = मॉडल। सीएचएफ़िल्ड (अधिकतम_लांबी = 100, रिक्त = सत्य, शून्य = सत्य) राज्य = अधिकतम = 1 = 100, रिक्त = सत्य, शून्य = सत्य) address_3 = models.CharField (max_length = 100, रिक्त = सत्य, शून्य = सत्य) models.CharField (MAX_LENGTH = 2, खाली = सच, अशक्त = सच) ZIP_CODE = models.CharField (MAX_LENGTH = 10, खाली = सच, अशक्त = सच) फोन = models.CharField (MAX_LENGTH = 30, खाली = सच, अशक्त = यह सच है) वर्ग मेटा: सार = सच वर्ग ProfileBilling (BaseAddress): प्रोफ़ाइल = models.OneToOneField (प्रोफाइल, related_name = 'billing_info') वर्ग OrderBilling (BaseAddress): आदेश = models.OneToOneField (आदेश, related_name = 'बिलिंग') name_on_card = मॉडल। चियरफिल्ड (अधिकतम_लांबी = 100) # कार्ड_टाइप = मॉडल। पॉजिटिव mallIntegerField (# विकल्प = CARD_TYPE, डिफ़ॉल्ट = 0) #card_number = models.CharField (# MAX_LENGTH = 16, डिफ़ॉल्ट = 0) expire_month = models.PositiveSmallIntegerField (विकल्प = महीने, अशक्त = सच, डिफ़ॉल्ट = 0) expire_year = models.PositiveSmallIntegerField (विकल्प = YEARS, शून्य = सत्य, डिफ़ॉल्ट = 1 9 60)   

जब ग्राहकों को बिलिंग पता इनपुट होता है, तो मैं इसे ऑर्डर बिलींग में सहेजना चाहता हूं, लेकिन मैं भी इसे ProfileBilling में सहेजना चाहता हूँ सबसे हालिया बिलिंग पता मैं ऐसा कैसे करूं?

जब मैं ऑर्डर बिलिंग और प्रोफाइल बिलिंग में अधिक से अधिक समान फ़ील्ड रखता हूं ...?

मैं बिलिंग पते को दो अलग-अलग तालिकाओं में सहेजने के लिए कैसे उपयोग करूं? मैं यह कैसे Django में कर सकता हूं?

यह मेरा ऑर्डर बिलिंग फॉर्म है:

  वर्ग OrderBillingForm (forms.ModelForm): क्लास मेटा: मॉडल = आदेशबिलिंग बहिष्करण = ('आदेश ',) डीईएफ़ __इनट __ (स्वयं, * एल्ग्स, ** क्वार्ज): सुपर (ऑर्डर बीलिंगफार्म, स्वयं) .__ init __ (* आर्ग्स, ** क्वार्ज) स्वयं। फ़ील्ड [' पता ']। आवश्यक = सच स्व। फ़ील्ड [' शहर '] .required = सच self.fields [' राज्य '] = USStateField () self.fields [' ZIP_CODE '] = us.USZipCodeField () self.fields [' फोन ']। आवश्यक = झूठी self.fields [' expire_month '] .required = False self.fields [' expir_year ']। आवश्यक = गलत def साफ (स्व): वापस स्वयं। स्केलिडे_डेटा    

आप सेव () विधि को ओवरराइड कर सकते हैं, लेकिन आपके मामले में स्मार्ट तरीके से इस प्रयोजन के लिए संकेत का उपयोग किया जाएगा।

OrderBilling सहेजा गया, आप अपने डेटा को प्रोफाइल बिलिंग में भी सहेज सकते हैं।

पोस्ट_एसएवी संकेत से परिचित होने के मामले में Google खोज पर कुछ उदाहरण को देखो,

जैसे:

  • आदि ...

    फिर आसानी से अपने पोस्ट_एसएव रिसीवर में | कॉलबैक Funcstion को ऑर्डर बिलिंग उदाहरण प्राप्त करें

      orderbil_instance = kwargs ['instance']   

    और अपने डेटा से अपना प्रोफाइल बिलिंग बनायें संकेत रिसीवर पर कुछ ऐसा है

      ProfileBilling.objects.create (name = orderbil_instance.name, ....)   

    / P>

      def do_something (प्रेषक, ** kwargs): # OrderBilling उदाहरण प्राप्त करने के लिए जो अभी बचाया है orderbil_instance = kwargs ['उदाहरण'] # नई प्रोफाइल में बिलिंग को भरना ProfileBilling.Billing.objects.create (name = Orderbil_instance.name, ....)    

java - Adding a BufferedImage to a JPanel on JLayerPane -


Therefore, I have a zeledadpan (technically a class sub-clinging JellyheadPen in fact). There is a JPNL on that I want to add a buffard image to zipal.

  The public class Bigmat JLearpine implies the MouseListener JP Penal Map Panel; Buffeedmeremet; Public Bitmap (Buffer Image M) {theMap = m; MapPanel = new JPanel (); Addition (Map Panel, 0); MapPanel.setBounds (0, 0, 640, 640); // other unimportant stuff} @ Override Public Waste Paint Coment (Graphics G) {SuperPaintConant (G); Graphics 2D GPMap = (Graphics 2D) MapPanel.Graph Graphics (); Gmap.drawImage (map, empty, 0, 0); // some other things that are working fine now) The problem is that the buffed image is not showing JPNL is definitely present because I can choose my background and If I want, I can see it. I know that JLED is not a layout manager in the pen and they have to set the limit for the zippin but this should definitely not be an issue for JPNL? And in the buffeted image there is a lack of ways to control its size, I do not know how to remove it, if it is.  

Any help appreciated.

The problem here is that you paintComponent () method of your layered panel No, not JPanel . JPNL will paint later as one of the children of your layered panel, and erase the paints you make from it.

In general, a paintComponent () method should be painted in graphics , which was not given in graphics of any other component.

Is there a defined method for storing Adobe XMP in HTML? -


Adobe Standard methods for storing XMP metadata inside many file formats including PMD, TIFF, JPEG, GIF, SWF Have defined. , MP3, MP4, etc. However, I do not find any documentation defining standardized method for storing XMR in HTML.

Note I look into XMP but I have found it In Adobe's specification, perhaps it helps:

All cited (page 41ff):

2.5.1 HTML

embed code in XMP must be in line with one of the W3C recommendations to embed html in XML For reference information, see the Meeting Report for the May 1990 W3C meeting:

L a SCRIPT or XML can be embedded in element, placed in any legal base; The suggested location is the end of the HEAD element SCRIPT or XML element of the element is XMP packet. The browser should recognize the SCRIPT or XML element so that the text representing the value of the RDF properties can not be displayed as a page content. Unlike the use of the xml element, unless the incompatibilities with the old software are known; If so, then the SCRIPT element is likely to be recognized.

2.5.1.1 Embedding XML in HTML

as shown in the examples below There are three approaches for embedding HTML in the XML two using the SCRIPT element, and the third XML element Uses

2.5.1.1.1 SCRIPT element and LANGUAGE attribute

  & lt; Html & gt; & Lt; Top & gt; & Lt; SCRIPT LANGUAGE = "XML" & gt; & Lt ;? Xpacket start = '' id = 'W5M0MpCehiHzreSzNTczkc9d'? & Gt; & Lt ;! - Serial RDF goes here. This is removed for brevity - & gt; & Lt ;? Xpacket end = 'w'? & Gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

Note : Adobe has problems with using the SCRIPT element and LANGUAGE attribute in Microsoft Word 2000 Microsoft has been running under Windows XP: body contents can not be displayed

2.5.1.1.2 SCRIPT element and TYPE attribute

  & lt; Html & gt; & Lt; Top & gt; & Lt; SCRIPT TYPE = "text / xml" & gt; & Lt ;? Xpacket start = '' id = 'W5M0MpCehiHzreSzNTczkc9d'? & Gt; & Lt ;! - Serial RDF goes here. This is removed for brevity - & gt; & Lt ;? Xpacket end = 'w'? & Gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

2.5.1.1.3 XML element usage

  & lt; Html & gt; & Lt; Top & gt; & Lt; Xml & gt; & Lt ;? Xpacket start = '' id = 'W5M0MpCehiHzreSzNTczkc9d'? & Gt; & Lt ;! - Serial RDF goes here. This is removed for brevity - & gt; & Lt ;? Xpacket end = 'w'? & Gt; & Lt; / XML & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; / Body & gt; & Lt; / Html & gt;    

linux - verifing some arguments in bash -


I'm verifying one in BASH

  if [! ((-e $ f) || ($ # -lt2) || (-D $ F));; Again exit 0f   

I am trying to see if the file exists or if it is a directory or if enough arguments pass through the terminal I can do this Or should it be done in any other way?

Reject anything that is not a simple file, in that case, instead of the -e If you use -f, then testing for a directory is unnecessary.

  If [[! -f "$ f" || $ # -lt2]]; Then exit 0f   

By the way, if this is an error, you should get away from something other than 0-0, in most cases, success indicates; Exit 1 will be better.

html - css: target a class which is inside a same class -


I am currently working on a WordPress project. There is a 3 level menu in it

.submenu must be hidden on the same page. Now I have to hide the .submenu , which is inside SabMedu.

How can I target it?

I have the goal #mainmenu> . Submenu & gt; .submenu

Just like #mainmenu .submenu .submenu .

how to run scalatest at package level in Eclipse -


I am using Skalate in Eclipse (Juno) with Scala 2.10, and run a test file in the Run configuration window Has a capacity, a test suite, or a test package. When I right click on the package name in the Explorer window, there is an option to run the package (thus running all tests in that package). However, when I do this, no test goes out and it displays it:

  Warning: -P is disliked and ScalaTest 2.0 has a different (but still Also very good) will be reused for the purpose. Please start to change all the uses of -p to -R The expected test number is: 0 Discovery site: Run is completed in 57 milliseconds. Total number of tests: 0 suits: full 1, canceled 0 test: successful 0, unsuccessful 0, neglected 0, pending 0 all examinations passed   

So, what else do I need to do Can I run all the tests in the package?

This leads the blind to blind, but what did I find when you test classes are same Discovery works, then moves into test classes in the package.

Strange.

oracle10g - Sql query: no rows selected -


I tried different forms of SQL statement, but I still do not have "no rows selected". I do not know where I'm going !.

Here's the question:

I have to list the titles of the conventions organized by those employees whose managers are 'Green'. / P>

The tables associated with the query are:

Employee_C Table:

  EID NAME Salary Center --- - - ---------------- ----- E01 Wilson 53000 E02 Smith 48000 E01 E03 Jones 38000 E01 E04 Loftus 41000 E05 Fox 54000 E04 E06 Smith 45,000 E04 E07 Green 48000 E08 Fox 49000 E04 E09 Wolf 41000 E04 E10 Wang 32000 E01 E11 Philips 33000 E07 E12 Liu 27000 E07   Table:  
  confid title location SDATE ------ -------------------- -------------------- - - ------ c00001 Hydroinformatics Singapore 15 Jun-12 c00002 Ecological_modeling Berlin 15-Jul-12 c00003 Computational_M London 25-May-12C00004 EcoInfo Rmatics Boston 22-Aug-12 c00005 Uncertainty_analysis Athens 10 Oct 12 c00006 Large_databases Toronto 13-APR-12 c00007 Systems_Annilalis Boston 23-March-12 c00008 Syst ems_integration Tokyo 24-FEB-12 c00009 Aquatic_biology Helsinki 12-May-12 c00010 Information_systems Paris 08 -Jan-12 c00011 Simulation_modeling Rome 01 September 12 c00012 DSS Melbourne December 18 12   

Deals_C Table:

  EID confid - - - E02 c00001 E03 c00001 E05 c00001 E06 c00001 E03 c00002 E08 c00002 E09 c00002 E10 c00002 E03 c00003 E05 C00003 e06 c00004 e08 c00005 e09 c00005 e10 c00005 e06 c00005 e11 c00006 e12 c00006 e05 c00007 e06 c00007 e08 c00007 e09 c00008 E10 c00008 e11 c00008 e 02 c00009 e12 c00009 e10 I have a SQL statement:  
  Select the C title from conference_c, where c. Choose Delska DD from D. Konfid (Choose E. Choose E.E. from Employee_C E, where E.Name = 'Green'));   

I did not select "No rows"

The problem is yours The query is that you are checking the wrong employee data. Checking your WHERE section EID on EID , when it actually checks Deals_C.EID employee. MID :

  Select the C title in the internal entry from Conferencing C (Select D. Confered, join the e-EID from DLSL-DE, Employees Edi IDEED = E.EID is where (selection from Employee_C e2 * where E2.Name = 'green' and e.mid = e2.eid)) c.CONFID = d.CONFID d   

See. The

EXISTS query is returning those rows that have the last name of green , but you Employee_C.MID Subcategories on EID .

It can also be written:

  from conference_c to c. Select the title where C Confid (Select D. Confered from DCAC DD Employee's EID = E. EID where it exists (Select from * Employee * E2, where E2.Name = 'Green' and e.mid = e2.eid)) ;   

View

apache - mod_pagespeed is not sending expected output with extended cache -


For testing purposes, I have this Apache configuration:

  & lt; Directory "/ home / http" & gt; ... & lt; File match ". (Html ​​| htm) $" & gt; Header set the header header set-up cache-control "max-age = 0, no-cache" & lt; / FilesMatch & gt; & Lt; File match ". (Jpg | jpeg | gif | png | js | css) $" & gt; Header set the header header set up cache-control "Public, Maximum-age = 10" & lt; / FilesMatch & gt; & Lt; / Directory & gt;   

It basically asks for setting static assets which stays up to 10 seconds for the cache, then for this test and display purposes

I Navigate directly to this file and test it out

  $ wget -O -. --save-header local host / mod_pagespeed_example / images / puzzle Jpg cache-control: public, max-age = 10   

Which works fine? But then I try to load the page with mod_pagespeed and extend_cache enabled

  $ wget -O - --save-header local host / mod_pagespeed_example / extend_cache.html ModPagespeed = on & amp; ModPagespeedFilters = extend_cache & lt; IMG src = "picture / puzzle.jpg" /> $ Wget -O - --save-header local host / mod_pagespeed_example / extend_cache.html ModPagespeed = ON & amp; ModPagespeedFilters = extend_cache & lt; Img src = "http: //localhost/mod_pagespeed_example/images/xPuzzle.jpg.pagespeed.ic.hgbHsZe0IN .jpg" />   

It's all right and dandy. The initial request does not work because it needs to load the information in the cache, but from there it is cached correctly, the src of the img tag changes with the broken version.

However, it only prevails until the maximum age. So, if I set it to 10 seconds, it will continue to point to http: //localhost/mod_pagespeed_example/images/xPuzzle.jpg.pagespeed.ic.hgbHsZe0IN.jpg , but Then go back to anywhere on Picture / Puzzle.jpg after 10 seconds, at that time it will be back in the cached version.

Is this the expected behavior? I would think that PageSpeed ​​will check the hash after the maximum age, and if it is the same, it is not bothered to change it back to the actual value, but instead the service of the cached file continues.

It's about to a certain extent. If I have set the maximum age to be more useful, then say that 60 minutes, which allows me to update these asset files and assures that my updates are viewed on time. However, if users visit the site once per day, then they are more than the maximum age and they always serve the original file instead of the cached version.

This is expected behavior as you mention, the reason is that the resource ends in the cache And we will have to re-examine it to ensure that it is still the same. We do not want to block the user request when we check all the sub-resources.

Note, one solution would be to use it. It will check the last modified time of the file on the disk and can also check if the resource cache is finished.

c# - Exception with IIS ASP.NET 4.0 and using reflection on private field -


IIS में asp.net 4 में चलने पर निम्न कोड के साथ एक समस्या हो रही है:

  डेटाटाईबल डीटी = नया डेटाटाइल (); फील्डइनफ़ोडा टेबलकेससेन्सिविटीएम्बेिएन्टफिल्डइन्फो = टाइपफ (डेटाटाइल) .GetField ("_ caseSensitiveUserSet", BindingFlags.Instance | BindingFlags.NonPublic); टेबलकेससेन्सिविटीएम्बिएन्टफिल्डइन्फ़ो .सेट वैल्यू (डीटी, सच);   

। SetValue () कॉल फ़ील्डएवेशएक्सेप्शन के साथ विफल हो जाती है (यह कोड सार्वजनिक स्रोत कोड फ़ाइल नाम एडीओनेटहेलपर सीएस से होता है जिसे कॉम्पैक्टफॉर्मरप्लस नामक सार्वजनिक स्रोत डीएलएल से उपयोग किया जाता है)

यह केवल तब ही होता है जब आईआईएस में होस्ट किया जाता है।

हमारा मानना ​​है कि यह एक प्रतिबिंब / कोड पहुंच की अनुमति के कारण है (एक उत्तर के लिए खोज करने के बाद), लेकिन हमें मूल्यों का सही सेट नहीं मिला है काम करने के लिए इस कोड को सक्षम करें।

कोई विचार ?? धन्यवाद, फ्रेड

निजी सदस्यों को दर्शाते हुए केवल तब काम करता है जब कोड पूर्ण विश्वास के तहत चलाता है। एएसपी .नेट डिफ़ॉल्ट रूप से मध्यम विश्वास में चलता है।

इसलिए, आपको इसके लिए पूर्ण विश्वास में चलाने के लिए अपने आवेदन को कॉन्फ़िगर करने की आवश्यकता है।

इस आलेख में यह कैसे समझाया गया है, लेकिन मूल रूप से आपको अपनी विधानसभा को & lt; फ़ुल ट्रस्टऐस्म्बलीज & gt; सूची कॉन्फ़िगर में & lt; सुरक्षा नीति & gt; तत्व।

java - Can a Program Differentiate between User Key Input and Program key Input? -


Is it possible to block key input from other programs for this program, but no key input by user's hands keyboard ?

For example:

Program A has a text field.

Programmable Windows has on-screen keyboard.

After selecting a text field, in Program A, I try to press the letter 'C' on the on-screen keyboard program but it does not appear in the text field.

However, when I press the letter 'C' directly with my keyboard, this program appears within the text area of ​​A.

I know how the key events are done, how they are queued, and I have seen the block input function in C ++

But this function only blocks all inputs

I have encountered programs that filter the input in such a way and can not detect how am I completely clear?

This question is mainly related to C ++ on the Windows 7 operating system.

You can never make sure that the simplest example is coming from an input hardware is a custom driver Powered by the software input will simulate the real keyboard.

Some fancy ideas can attach the microphone to the device, to listen to sound / vibrations for input filtering, but do you have full hardware solutions or applications, which will be given to individual users?

detection - How to detect whether or not an Android phone has a specific app installed? -


I have previously used the meta tag described in this to detect the iPhone app:

Now I'm trying to do this to sniff the Droid-App. Actually, I want to know whether the user has a 'sniffing' app installed or not.

How can I find out if the smartphone has an Android app installed or not?

To change the code function, with "com.your.package.appname.id" application ID.

ID app packages and market URLs eg There is a Gmail App URL in the market and id / packagename is com.google.android.gm

  import android.app.Activity; Import android.content.pm.PackageManager; Importroid.os.Bundle; Public category example enhances activity {@ Override Protected Zero to Create (InstantState saved from bundle) {super.onCreate (savedInstanceState); SetContentView (R.layout.main); // Put the package name here ... Boolean installed = app installed ornot ("com.your.package.appname.id"); If (installed) {System.out.println ("the app has already installed your Android OS"); } Else {System.out.println ("The app is not installed on your Android"); }} Private Boolean application installed OrNot (string uri) {PackageManager pm = getPackageManager (); Boolean app_installed = false; Try {Pm.getPackageInfo (uri, PackageManager.GET_ACTIVITIES); App_installed = true; } Hold (PackageManager.NameNotFoundException e) {app_installed = false; } Back to app_installed; }}    

android - Google In app Billing V3 ERROR Code -


ऐप बिलिंग v3 में रिस्पांस कोड रिटर्न देता है (BILLING_RESPONSE_RESULT_USER_CANCELED: 1) -1005 एक से अधिक परिदृश्य में।

खरीद प्रवाह को लॉन्च करने से Google Play- जैसी UI खुल जाता है जब भी इस UI में एक त्रुटि आती है, तो कहें कि एक नेटवर्क वियोग / समय समाप्त / आइटम अनुपलब्ध / खरीदा गया आइटम, एक संवाद त्रुटि को इंगित करने के लिए फ़ैशन करता है। जब ठीक क्लिक किया जाता है, रिस्पांस कोड: उपयोगकर्ता रद्द किया गया (1) हमेशा ऑनएक्टिविटी रिजल्ट इन्टेंट एक्स्ट्राउस में वापस आ गया है। एंड्रॉइड डेवलपर की साइट पर संदर्भ के अनुसार यह तब होता है जब उपयोगकर्ता गतिविधि / संवाद को रद्द करता है, जिसे मैं स्पष्ट रूप से नहीं करता।

मैं अलग-अलग त्रुटियों को अलग करना चाहता हूं और उन्हें संभालना चाहता हूं व्यक्तिगत रूप से मेरे ऐप में एक भी त्रुटि कोड वापस करने में मदद नहीं करता है किसी भी एक का सामना करना पड़ा अभी तक? रिकॉर्ड के लिए, ऐसा लगता है कि Google Play क्लाइंट के साथ यह कोई समस्या है?

Google ने संस्करण 4.0+ के रूप में जीपी क्लाइंट को अद्यतन रोल आउट करना प्रारंभ कर दिया है और बग को ठीक किया गया है।

codeigniter - How to include language files for each module in HMVC? -


I am using CodeIgniter with HMVC and I use the language files for each module except the language files from the CodeIgniter language folder:

Would like to use

Is this possible?

If so, how can I do this?

e.g. I have footer with a structure like this:

  module footer controller footer. Php language English footer.php check footer.php model footer_model.php footer footer.php   

and the footage of this module will be a message in footer.php:

 < Code> $ echo-> lang - & gt; Line ('copyright_message');   

Where the key copyright_message is stored in English for language / english and in a folder in the folder footer.php Will be done / for check

How to apply such code in code HGVC for Igniter?

Does this code correctly identify python strings -


I have some code that I think should return all the parts of a dragon statement that are not in the string. However, I am not sure as much as the harsh I want. Basically, it only finds the next string delimiter and stays in the "string" position until it is closed by the same delimiter. Did I do anything wrong for something strange that I did not think? Will anyway be incompatible with the dragon? In order of precedence, # string delimiter string_delims = ['' '', '', '', '', '', '' '] #A statement without a def def Get _get_non_string (text): out = "state = none true: # not in string if state == none: vals = [string_delims in [text.find (s) for s # if only For valve-1 (i.e. no substring), there will be no difference in the zip (wal + [none], string_dialize + [none]): if val == none: out + = return the text if the wall & Gt; = 0: i = val = Destroy break = = text [: i] text = text [i + len (delim):] else: i = text.find (state) if i & lt; 0: increase syntax error ("cyobolic subsystem: eol Examples input:

  get_non_string ("hello") "text" string "string" string = text [i + len (delim)] stat = none   

/ Pre>

Python can detect Python code:

  import import token To chop the imports Import to IO import store class token (collections.nametuple ('Token', 'num val start end line')): @property def name (auto): return token.tok_name [self.num] def get_non_string (text): Result = [] tokenize.generate_tokens (io.BytesIO (text).) For token: token = token (* tok) # print (tok.name, tok.val) if tok.name! = 'STRING': Results .append (tok.val) return '' .join (results) print (get_non_string ("hello" 'everybody' '' :) '' ''))   

The yield

  Hello!   

Heavy weight lifting is done by.

apache - URL Rewriting doesn't seem to work. Apache2 -


मुझे यह पसंद है, जब उपयोगकर्ता http://mysite.com/home यह उसे http://mysite.com/page.php?id=home पर पुनर्निर्देशित करता है। यह मैंने अपने .htaccess में डाल दिया है, लेकिन यह काम करने के लिए प्रतीत नहीं होता। <पूर्व> RewriteEngine On RewriteRule ^ / (। +) $ Page.php? Id = $ 1 [एनसी, एल]

यह मुझे / घर निर्देशिका, एक अच्छा 404 के साथ। मदद की सराहना की है। धन्यवाद।

संपादित करें:

मैंने कुछ पुन: लिखने की कोशिश की है, मुझे काम पता है, इसलिए अब मुझे यकीन है कि यह मेरी समस्या नहीं है। मैंने phpinfo () के साथ जांच की और हाँ, आधुनिक पुनर्लेखन चल रहा है, मैंने अपाच 2 को LAMP के साथ सेट किया है, मैं लिनक्स टकसाल का नवीनतम संस्करण चला रहा हूं।

ठीक है मैंने समस्या को ठीक किया, इस तरह मैंने इसे किया।

sudo gedit / etc / apache2 / sites - / />

और फिर मैंने / var / www / में अनुमति दें को अनुमति दें < कोड> फ़ाइल का भाग

  & lt; निर्देशिका / var / www / & gt; विकल्प इंडेक्सों का पालन करें SymLinks मल्टीविज़ अनुमति दें ओवरराइड सभी # यह 'कोई नहीं' पहले था, इसे 'ऑल' ऑर्डर की अनुमति दें, सभी को अनुमति देने से इनकार करें & lt; / Directory & gt;    

jquery - Having a strange JSON Parsing issue -


I know there are so many questions of JSON parsing posted before, none of them are helping me is.

I am redirecting AJAX from PHP with AJAX to my page. According to JSONLint.com I am using valid JSON.

My issue every time I go to reach the properties of my object, as if they come back undefined. I console.log Jason object and it comes out right away. I'm confused!

PHP
  $ returnData [] = array ("trainingAccess" => "$ trainingAccess", "destinationUrl" => "$ destinationUrl", " Error message "= & gt;" $ error message "); Echo json_encode ($ returnData);   

JS
  $ .ajax ({type: "POST", url: "submit_login.php", data: {username: $ (" # Val (), Password: $ ("#password"). Val ()}, success: function (data) {var obj = JSON.parse (data); console.log (obj); // works warning (obj .destinationURL); // does not work.}   

solution

I was creating an array of arrays in PHP.

$ ReturnData = array ("trainingAccess" => "$ trainingAccess", "destinationUrl" => "$ destinationUrl", "error message" = & gt; "$ errorMessage");

Ajax Value, and it can parse it comes with the right content type.

Specify the data type so that you can make sure what is happening, then you know that the data is already in your Parsing for:

  $ .ajax ({type: "POST", url: "submit_login.php", data: {userName: $ ("# userName"). Val (), Password: $ ("# password") Val ()}, Data Type: 'Jason', Success: Joy Ction (Data) {console.log (data); Warning (data [0] .destinationUrl); }    

Grails GSP outer templates with inner content? -


Is Grails a way to change the following in GSP

  < Tmpl: / Template / Header / & gt; & Lt ;! - tmpl namespace call & lt; G is equal to: template = "/ templates / header" /> Render - & gt; & Lt ;! - Definition of internal content - & gt; & Lt; Tmpl: / template / clergy / & gt;   

with external template? Basically, a way to import wrapping exterior template,

  & lt; Outertemplate: templatename & gt; & Lt ;! - Header will be sung from the external template - & gt; & Lt ;! - Definition of internal content - & gt; & Lt ;! - Footer will be provided from external template - & gt; & Lt; / Outertemplate: TEMPLATENAME & gt;   

and the definition of an external template

    

Capturing two templates versus wrapping content in a single template. IIRC was there a way to do this under JSF, but I could not find any equivalent under GSP.

You can create something like using the tag library.

  class SimpleTagLib {def emoticon = {attrs, body - & gt; Outside & lt; & Lt; Body () & lt; & Lt; (Attrs.happy == 'true'? ":-)": ":: :-("}}}   

This defines a tag emoticon Which may be used in GSP such as:

  & lt; G: emoticon happy = "true" & gt; Hi John & lt; / G: emoticon & gt;   

body () is used to render tags body content.

(example is copied from official)

android - How to make an on-the-fly refresh on Google Maps v2 -


I am using services that calculate late long with some addresses stored in a database. When I have a lot of addresses, it is slow to calculate and when I open Google Maps, not all markers are displayed on the screen, because the service is still calculating in the background

Thank you

You probably should geocode the data when it is inserted in the database instead of being displayed . As you've seen, geocoding is slow, and it would be better to cache gocade results. Or to save at least the Geocode result, you have to face an address for the first time.

Note: Google has restrictions on its restrictions, for which you can use your geocoding service. If you have used Google's GeoCoding, you are only allowed to use that Latitude / LNG with the Google Maps API.

There are free / open source geocoders present in my opinion / experience, Google's GeoCoders are better than those with open source. (But there are restrictions in it.)

python - Arduino hit counter -


We are having trouble getting data from the serial port. We have this python code, its purpose is to get value from a file It then enhances it, we are trying to connect it with the arduino with a motor servo like when it detects a pay increase, servo moves.

  # Fetch counter # import time import urllib import serial # USB serial connection Last_counter: b = b.strip () while (True): counter = open ("hitcounter.txt") For arduino ser = serial.Serial ('COM3', 9600) last_counter = open ("hitcounter.txt") for b. ) In a counter: a = a.strip () delta = et (a) - int (b) ash = delta + 1 print gate print "counter:% s, delta:% s"% (a, delta) x = Print (% s) (print) (%) (print) (%) % (Y) b = a time.Sol (10)    

In your code: After (True):

The line is not indented after that, so code is not part of the block. Your code will only have an idle loop here. Assume that I understand your code logic:

  # # Fetch counter # import time import urlib import serial # USB serial connection arduino ser = serial (Serial): Counter = Open ("hitcounter.txt") for A = A while while (True): B = B. Strip (last) if last_counter: b = b.strip () last_counter = Open ("hitcounter.txt") Open the .strip () delta = int (a) - int (b) gate = delta + 1 print ass print "counter:% s, delta:% s"% (a, delta) X = chr (ser.write (chr ord (chr (delta))))) print type (x) print "% S"% (x) y = ser.write (ass) print type (y) print "% s"% (y) b = one time.So (10)    

c++ - Priority Queue of Nodes -


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

  • 2 जवाब

    मैंने एक प्राथमिकता बनाई है नोड्स की कतार, मैंने कतार में नोड को 'धक्का दिया', धारणा के साथ कि यह पूर्णांक मानों के क्रम में नोड्स को सॉर्ट करेगा शायद कि मुझसे गलती हुई थी। नोड में गुण हैं, इंट फ़्रीक, और चार सी। मैं इसे ints के क्रम में हल करना चाहता हूँ, सबसे छोटी से सबसे छोटी।

      priority_queue & lt; नोड * & gt; क्यू; के लिए (i = 0; i & lt; 95; i ++) {क्यू। पश (नोड_अरे [i]); } के लिए (i = 0; i & lt; 95; i ++) {cout & lt; & lt; Q.top () & lt; & lt; endl; Q.pop (); }   

    मैं इसे 'freq' के क्रम में कैसे बना सकता हूं?

    आपकी प्राथमिकता की तुलना पॉइंटर्स, यानी मेमोरी पतों की तुलना कर रहा है। आपको नोड से तुलना करने वाले द्विआधारी मकसद प्रदान करने की आवश्यकता होती है जो दो नोड * लेता है और इच्छित तर्क को लागू करता है:

      struct node_cmp {bool operator () (const node * a, Const नोड * ख) कन्वर्स (रिटर्न ए- & gt; कुछ फिल्ड & lt; बी & gt; someField; }};   

    प्राथमिकता कतार को इन्स्तांत करने के लिए इसका प्रयोग करें:

      std :: priority_queue & lt; नोड *, std :: vector & lt; नोड * & gt ;, node_cmp & gt; क्यू;    

Play a stream of G711 encoded audio using Java? -


क्या यह javax.sound.sampled या कुछ अन्य अंतर्निहित जावा लाइब्रेरी का उपयोग करना संभव है जावा एप्लेट में ऑडियो चलाएं? ऑडियो सामग्री प्रकार ऑडियो / मूल है और यह G711 एन्कोडेड है।

ऑडियो स्ट्रीम का उपयोग कर रहा हूँ एक्सिस नेटवर्क कैमरा के ऑन-बोर्ड HTTP सर्वर से निकलता है। मैं एएसी या जी 726 एन्कोडिंग में भी ऑडियो प्राप्त कर सकता हूं।

मुझे javax.sound । लेकिन मुझे लंबे समय से सन जावा लाइब्रेरी याद है, जो जी.711 डेटा सहित ऑडियो संभाला। एक छोटे से खोज से पता चलता है सामान्य पीसीएम ऑडियो के लिए G.711 डेटा डिकोड करने के लिए, या तो कक्षाएं देखें क्या ऑडियो के लिए कोई अन्य इनकैप्सुलेशन है, या क्या यह सिर्फ हेडडर के साथ ही नकल लॉगरिदमिक पीसीएम बाइट्स है? यदि इनकैप्सुलेशन है, तो उस पर कार्रवाई करने के लिए अन्य कक्षाएं हो सकती हैं (जैसे कुछ)।

git - setting up gerrit -


The documentation is not very good for setting me up. Managing database is not my strong suit, so it is not friendly to me as well.

What do I have:

I have a desktop and an AWS server running gerit.war file is Ubuntu.

Reading on the Installation Guide I see all these commands that I want to run, but I do not know at all that I am saying this. On the server? Some Terminal?

I know that this is probably not Nobie, but I am getting frustrated.

Any help or documentation will be highly appreciated.

The commands must be run on the server.

First copy of the guarantee. Through the war file (SCP, FTP or whatever upload method AWS provides) on the server, and then execute the commands shown in the documents using the terminal.

sql server - Not include records from within a select query matching a criteria -


I have a query in SQL Server which is displaying some records that I want. The relationship of the field is as follows:

A client ID can have multiple workloads (workload IDs), but not on the other side (one-to-many). In each workload id it is a unit, in each workload id, it is DWLD (date) which it has been assigned to. Multiple WorkloadID can have the same client ID, DWLD, and unit.

Here is a query:

  Select w.WorkloadID, w.ClientID, w.Unit, w.DWLD WWWD & gt; = @ Start & WWW & lt; Remove from workload as client in w.ClientID = cli.ClientID; @Adadet and W. Deleted & lt; & Gt; 1   

I just do not want to display one of the few records, which is the same clientId and the same unit and the same DWLD.

Thank you!

Try this query when you are not receiving records from the client table, there is no need to be included in it.

  Select w.WorkloadID, w.ClientID, w.Unit, w.DWLD Workload, WWW @ dot and @adett and WWEIdited & lt; & Gt; 1 more not (select * workload WEHRE ClientId = w.clientid and unit = w.unit and dwld = w.dwld and workloaded; between w.workloadid and DWLD @ start and @enddate and isDeleted & lt;> 1 )    

backbone.js - Backbone View events don't get destroyed -


I'm having trouble with no point-of-view events, i mean a scene

  var myView = Backbone View. Extension ({events: {"click" .item ":" next page "," scroll ":" iscrolling "," click on click .zoom ":" imagez "}, start: function () {this.collection .on ("reset", render it,);}, execution: function () {...}}); Var Views = New MyView (); DestroyArray.push (see);   

Once I need to delete the view, I call through my router, a function that loop through the deleted array and destroy the arrows [i]. Close () (see below) before submitting the next scene. backbone.view.protitip.clo = function () {this.undellegateEvents (); The $ el.removeData () nickel () .. This.remove (); If (this.onClose) {this.onClose (); }}

Removes the view from the close functions page, but events (and dom elements) actually move forward and backward in the incremental scenes. Is there something that I am doing wrong?

When I walk between scenes, I'll restart them. I.e.

  var view = new myView (); DestroyArray.push (see); ... view.close (); ... var view1 = new myView1 (); DestroyArray.push (View1);   

I thought that my problem could arise, but the incidents that have been added are not equal to the number of incidents bound in the scene.

Any help is greatly appreciated. Thank you.

Please take a look at the methodology presented in backbone 0.9 to help deal with the removal.
You may have:

  start: function () {this.listenTo (this key, 'reset', this.render); } Backbone.view.protipip.close = function () {this.remove (); }   

In addition you do not have to specify the reference with this method.

Edit: Did it before.

javascript - angular js adding two numbers issue -


मुझे इस कोड को कोणीय जेएस का उपयोग किया गया है:

  & lt;! DOCTYPE html & gt; & LT; html & gt; & Lt; शीर्ष & gt; & Lt; शीर्षक & gt; शीर्षक रहित पृष्ठ & lt; / title & gt; & Lt; स्क्रिप्ट प्रकार = "टेक्स्ट / जावास्क्रिप्ट" src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js" & gt; & lt; / स्क्रिप्ट & gt; & Lt; स्क्रिप्ट प्रकार = "टेक्स्ट / जावास्क्रिप्ट" & gt; फ़ंक्शन टोडोकटल ($ गुंजाइश) {$ scope.total = फ़ंक्शन () {वापसी $ scope.x + $ scope.y; }; } & Lt; / script & gt; & Lt; / head & gt; & LT; बॉडी & gt; & Lt; div ng-app & gt; & LT; h2 & gt; गणना & lt; / h2 & gt; & Lt; div ng-controller = "TodoCtrl" & gt; & LT; प्रपत्र & gt; & Lt; li & gt; नंबर 1: & lt; इनपुट प्रकार = "टेक्स्ट" एनजी-मॉडल = "x" / & gt; & Lt; / li & gt; & Lt; li & gt; संख्या 2: & lt; इनपुट प्रकार = "टेक्स्ट" एनजी-मॉडल = "या" / & gt; & Lt; / li & gt; & Lt; li & gt; कुल & lt; इनपुट प्रकार = "टेक्स्ट" मान = "{{कुल ()}}" /> & lt; / li & gt; & Lt; / प्रपत्र & gt; & Lt; / div & gt; & Lt; / div & gt; & Lt; / body & gt; & Lt; / html & gt;   

मैं गुणन, विभाजन और घटाव करने में सक्षम हूं, लेकिन इसके अतिरिक्त, कोड सिर्फ x और y मानों को जोड़ता है (अर्थात यदि x = 3 और y = 4, कुल 34 है

यदि वह वास्तव में है तो मामला क्या हो रहा है वह मान है जो एक्स और वाई के लिए पारित किए जा रहे मूल्यों को तार के रूप में माना जा रहा है और सम्मिलित किया गया है। आपको क्या करना चाहिए, उन्हें parseInt

  वापसी parseInt ($ scope.x) + parseInt ($ scope.y) का उपयोग करके संख्याओं में कनवर्ट करना है;   

या यदि आप संक्षेप पसंद करते हैं

  वापसी $ scope.x * 1 + $ scope.y * 1;    

SQL select statements in C# -


I have a problem facing the code below ( syntax error ). Please help me, what should I do. Thank you

Table column: PID, pAltId, pMobile, pdate, pName

variable: argID, alt_ID, p_mobile, p_date, p_Name

Statement:

  string selectStr = "select * to" + thisTable + "where pid = '' + + +" + + + + + + + + or + pAltId = "+ Alt_ID" + OR + pMobile = "+ p_mobile" + OR + pDate = "+ p_date" + OR + pName = "+ p_Name" '';    

"itemprop =" text ">

in +" where pid = '' + + "argid +" The value for PID should be in single quote or not? You have an initial ', but no end.

In addition, you are missing a number of double quote marks or they are missing the wrong place, a number of spaces, and try to start pName for 'Remember' :. "Select from" *

  string selectStr = + thisTable + "where PID =" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + or + "pmobile = "+ P_mobile +" "+ or +" pdate = '' + p_date + "'+" + or + "pName =' '+ p_Name +' '" 

if PMobile is a string, you can type it from + "pMobile =" + p_mobile + "" to + "pMobile = '" + P_mobile + "' '' '

django - Using values_list and extra on same queryset -


I have some existing code that calls values_list to query I need to use something extra to this query If I make additional calls before values_list, then additional items have gone from query after values_list, if I make an additional call after calling value_list, then it has to be affected - additional goods are not in the query.

Here are some debugger outputs before Values_list - additional - then there is:

  -> Queryset = queryset.extra (select = {Field ['name']: field ['name']}) (pdb) n - & gt; Queryset = queryset.values_list (* self.get_search_columns ()) (pdb) print queries. Select some (top to bottom) as `top-bottom`, .... (pdb) n - & gt; Data = List (QuerySet) (PDB) Print queries. Select the query `data_cst`.image_measurer_id`,` data_cst` .`image_pr_top_id`, `data_target``name`,` data_recipe``` name`, `data_cst`. `AP`,` data_lot````````````````````````````````````````````````````````````````````````````` Insert `` data_strip`` `data_strip``` from` data_stat```` to `data_recipe` (include` data_cst``recipe_id` = `data_recipe`.`id`) and join` `data_lot`` (` Data_cst`.`lot_id` = `data_lot`.`id`) WHERE (` data_cst`.`date_time` & lt; = 2013-03-26 23:59:59 and `data_cst`.`date_time` & gt; 2010-03-26 00:00:00) Order `date_time` DESC by` data_ cst`   

But if I cancel the order, then there is absolutely no additional query:

  -> Queryset = queryset.values_list (* self.get_search_columns ()) (pdb) n - & gt; Queryset = queryset.extra (select = {field ['name']: field ['name']}) (pdb) print queries Select the query `data_cst`.image_measurer_id`,` data_cst` .`image_pr_top_id`, `data_target` .`name`, `data_recipe`.`name`,` data_cst`.ep`, `data_lot`.`name`, Join `data_cst` inside` data_cst`.`tate_time`, `data_cst`.`bottom` (` data_cst` .`target_name_id` = `data_target``id`) join` data_reip` at INNER ( `Data_cst` .`RIPI_ID` =` data_press_``````````) join inner 'data_lot` on current (`data_cst`.` Lot_id` = `data_lot````````````) WHERE (`Data_cst` .`date_time` & lt; = 2013-03-26 23:59:59 and` data_cst`.`date_time`> = 2010-03-26 00:00:00) `data_cst` .date_time Order-n - & gt; by DESC (PDB) Data = List (QuerySet) (PDB) Print queries. Select the query `data_cst`.image_measurer_id`,` data_cst` .`image_pr_top_id`, `data_target``name`,` data_recipe``` name`, `data_cst`. `AP`,` data_lot````````````````````````````````````````````````````````````````````````````` Insert `` data_strip`` `data_strip``` from` data_stat```` to `data_recipe` (include` data_cst``recipe_id` = `data_recipe`.`id`) and join` `data_lot`` (` Data_cst`.`lot_id` = `data_lot`.`id`) WHERE (` data_cst`.`date_time` & lt; = 2013-03-26 23:59:59 and `data_cst`.`date_time` & gt; 2010-03-26 00:00:00) Order `date_time` DESC by` data_ cst`   

Is there a way to use both values_list and additional on the same query?

Here is a very simple example showing that this is not working: .

  (PDB) CST.objects.all () additional (selection = {'EP': 1}). Values_list ('image_measurer_id') [(86456L), (86454L), (86452L), (86450L), (86448L), (86446L), (86444L), (86442L,), (86440L, ), (86438L), (86436L), (86434L), (86432L), (86430L), (86428L), (86426L), (86424L), (86422L), (86420L, ), (86418L,), '... (decreased remaining element) ...']   

It should return 2 columns per line.

You must include your additional selection in values_list.

Example

  CST.objects.extra (select = {'ep': 1}) values_list ('image_measurer_id', 'ep')    

Rails form_for in Twitter Bootstrap Modal with AJAX/JSON -


I have a problem in the form of rail form for the form to work in the bootstrap model and to update a table with AJAX is. I have followed the guide, there is no benefit. I have also tried to follow the advice given in the links at the bottom of this question.

On the index view, I have a driver and have a button to add a new driver. The button brings the model to a new driver with a form. When the form is deposited, I want to close the model and the new driver appears alphabetically in the driver table. Now what is happening is that the model comes up and shows the form, but clicking on the submit button does not stop the modal and the new driver is not added to the database.

Here's a summary of app / view / driver / index.html.erb :

  & lt; Div & gt; & Lt; A href = "#deviceadmodal", role = "button", class = "btn btn-medium btn-primary", data-toggle = "modal" & gt; Add driver & lt; / A & gt; & Lt;% = Render 'new_driver'% & gt; & Lt; / Div & gt; & Lt; Div & gt; & Lt; Table id = "driver" category = "table-table-hover" & gt; & Lt; Thead & gt; & Lt;% = Render 'list_header'% & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; & Lt;% = render @ drivers.sort_by (and: last_name)% & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; / Div & gt; Modal is partial on   

here App / Scene / Driver / _new_driver.html.erb :

  & lt; Div id = "driver additional model", class = "modal hide fade" & gt; & Lt; Div class = "modal-header" & gt; & Lt; Button type = "button" class = "off" data-rejected = "modal" Aria-hidden = "true" & gt; And;; & Lt; / Button & gt; & Lt; H3 id = "driverAddModalLabel" & gt; Add driver & lt; / H3 & gt; & Lt; / Div & gt; & Lt; Div class = "modal-body" & gt; & Lt;% = form_for @driver, Remote: True Do | F | & Gt%; Last name & lt;% = f.text_field: last_name% & gt; & Lt ;! - More form fields - & gt; & Lt;% = f.submit "Add Driver", Category: "BTN BTN-BTN-Primary"%> & Lt;% end% & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

App / Controller / Driver_Controller RB :

  class driver communicator & lt; ApplicationController def new @driver = driver. Make a new end DRF @ Driver = Driver. New (Param [: Driver]) response_to do | Format | If @driver.save format.html {redirect_to @driver, notice: 'driver added.' } Format.js {} format.json {render json: @driver, position :: created, location: @driver} and format.html {action: "new"} format.json {json: @driver.errors, status: : Unprocessable_entity} End end end DEF index @ driver = driver. NY @ Drawers = Driver. All answers do not do it. Format | Format.html End End   

App / Ideas / Drivers / create.js.erb :

  $ (" Lt;% = Escape_javascript (render @ driver)%>) Apendoto ("#driver");   

App / assets / javascript / drivers. Js.coffee :

  $ (document) .ready - & gt; $ ("#New_driver"). ("Ejax: success", (e, data, position, xhr) -> gtc: $ ("# new_driver") .append xhr.responseText .bind "ajax: error", (e, exhaor, status, error) - & gt; $ ("#New_driver"). Add "& lt; p & gt; ERROR & lt; / p & gt;" Unfortunately, I do not know how to apply advice on those pages on my app. I am normally new to rail and programming and this is my first AAAx or JSON climb.   

It seems that you are very new to the railways. In your case, I suggest that when you submit the form you read and read the log files and also log the parameter [: Driver] to see that all the fields are there, and the verification of your model See for After Driver.errors.inspect says that the reason for verification is due.

Yoga:

  1. Check the logs if there is a request to make your controller.
  2. Output all the parameters to present everything as expected.
  3. Output 'success' and output driver in the field of success. / Ol>

    Then you are good to see all the bugs.

    Oh, I recommend that you see the rail crast, they got everything there.

go - How to convert to nested type -


मैंने दो प्रकारों को परिभाषित किया है

  प्रकार zFrame [] बाइट प्रकार zMsg [] ZFrame   

और मेरे पास चर

  var संदेश [] [] बाइट   

जब मैं संकलन करने की कोशिश करता हूं

  msg (प्रकार [] [] बाइट का उपयोग नहीं कर सकता   

P>

  myZMsg: = zMsg (संदेश)   

<पूर्व> टाइप करें zMsg [] [] बाइट

में बदलता है बातें संकलन करता है, लेकिन मुझे पहला समाधान बेहतर पसंद है [] [] बाइट से zMsg से उस स्थिति में बदलने का कोई आसान तरीका क्या है?

आपको रूपांतरण स्वयं करना होगा उदाहरण के लिए,

  पैकेज मुख्य प्रकार zFrame [] बाइट प्रकार zMsg [] zFrame func main () {var संदेश [] [] बाइट myZMsg: = make (zMsg, len (message)) के लिए I: = श्रेणी संदेश {myZMsg [i] = zFrame (संदेश [i])}}    

graphics - c++ using text files to make graphs -


So I want to use large files with big names, and the names being used each year since 1880 Frequency of There is a text file for each year with names and frequencies. I need to read in the text files and the user input has a name and a year, which they want to see the frequency (which is not my problem, I can do this). When the user inputs in the name and the year, however, I should see a line graph which shows the frequency of the name as y-axis and the year shows as X-axis. I am using Marro which allows the use of graphics and which is not, but where should I start? I have lost a lot on how to do this.

Before I was doing something similar (but in ASCII), I quickly realized There were two options: A) The graph would not look well, and in fact the only SCREEN_WIDTH years would fit, B) The graph will only show the most interesting year C) The graph will not fit on a screen. D) You will not agree to somehow suitable for a screen.

Personally I select the option C, which can be solved as follows: Each column is one year (or a year category). Set that column's line at the same height as the "value" color equal to "COLORED".

There is only one problem in the number of rows, because we can only fit the SCREEN_HEIGHT elements in there. Unless, the shape of the line was shown, it was acceptable for me, so the sacrifice of precision was worth it.

ios - Cloning a uiview defined in interfacebuilder? -


I have a UIView built in an interface builder, which is a subviewview of Scrollview. UIView has a button and a label. I would like to use this view as a cookie cutter so that I can produce different examples of this view of the coalition next to each other in ScrollView.

I can do this program but this means That I have to define projectmatically in terms of visual size and subprints programmatically, what I like to do, define an example of the scene in the interface builder Shall do, so I am able to make it out and then the program copies of the footage. Its goal is to define the layout to reduce the code as much as possible of the interface builder, which I have to write.

I have created a UIView square to manage it. @interface UIView (JLTDeepClone) - (ID) deepClone; @end @ Implementation UIView (JLTPP Clone) - (ID) DeepClone {NSMUtableData * Data = [NSMUtableData Data]; NSKeyedArchiver * archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data]; [Collector encoded object: key for self: @ "view"]; [Archive end encoding]; NSKeyedUnarchiver * unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData: data]; UIView * Result = [unarchiver decodeObjectForKey: @ "View"]; [Autocomplete finish decoding]; Return result; } @end

Determining if two file paths point to same file under Linux / C? -


लिनक्स के अंतर्गत, मेरे पास दो फ़ाइल पथ हैं A और B:

  const char * A = ...; Const char * B = ...;   

अब मैं यह निर्धारित करना चाहता हूं, क्या मुझे open (2) दोनों चाहिए ...

  int fda = open ( ए, ...); Int fdb = ओपन (बी, ...);   

... क्या मैं फाइलसिस्टम में एक ही फाइल के लिए दो फाइलहेन्डल खोल सकता हूं?

इसे निर्धारित करने के लिए मैं stat (2) : <पूर्व> संरचना स्टेट {dev_t st_dev; Ino_t st_ino; (छद्म कोड):

  bool isSameFile (const char * sA, const char * sB) {stat A = स्टेट (एसए); स्टेट बी = स्टेट (एसबी); वापसी एस्ट_डेव == बीस्ट_डेवी & amp; amp; एस्ट_इनो == बीस्ट_नो; }   

क्या ऐसा कोई भी मामला है जहां ए और बी एक ही फाइल हैं लेकिन IsSameFile झूठी बदलेगी?

क्या कोई ऐसा मामला है जहां ए और बी अलग-अलग फाइल हैं, लेकिन IsSameFile सच वापस आएगा?

क्या मैं करने की कोशिश कर रहा हूँ करने का एक बेहतर तरीका है?

आपका प्रोग्राम सभी मामलों में ठीक काम करेगा क्योंकि एस्ट_िनो इनोड नंबर आपके सिस्टम में फाइल की चूंकि आइनोड नंबर अद्वितीय है आपका प्रोग्राम सही ढंग से पहचान करेगा कि क्या दो फाइल्स खोली गई हैं या नहीं।

आप फ़ाइल प्रतीकात्मक लिंक है या नहीं यह जानने के लिए एस्ट_मोड के मान भी देख सकते हैं।

javascript - ajax query error on callback -


  $ (यह) .find (': submit')। Attr ('disabled', true); $। एजेक्स ({url: '/ enviarSugerenciaMessageBoard', cache: false, टाइप करें: 'पोस्ट', डेटा: $ (यह) .सिरियालाइज़ (), सफलता: फ़ंक्शन (सफलता) {अगर (सफलता == 'Envio correcto') (Console.log ('envio correcto'); $ (this) .find (': submit')। Attr ('disabled', false);} else {console.log ('त्रुटि एन एल envio'); $ ( यह) .find (': submit')। Attr ('disabled', false);}}});   

यह एजेक्स क्वेरी काम करता है ठीक है जब मुझे सर्वर से 'एन्वीओ सही' मिलता है, तो कंसोल में मुझे एन्विओ सही मिलती है, लेकिन अटूट अक्षम झूठे काम नहीं करते ... < पी> मैं एन्दन या प्रीपेड जैसे अन्य कार्यों को बनाने की कोशिश करता हूं लेकिन काम नहीं करता

यहां तक ​​कि async: false

क्योंकि यह कीवर्ड उस तत्व से संबंधित नहीं है, जो अब सफलता फ़ंक्शन में है। इस वैरिएबल को आप अन्य चर में बैकअप लेना चाहिए, जितना कि आप इसे इस्तेमाल कर सकते हैं।

इस तरह,

  $ (this) .find (': submit')। 'अक्षम', true); Var आत्म = यह; $। एजेक्स ({url: '/ enviarSugerenciaMessageBoard', cache: false, टाइप करें: 'पोस्ट', डेटा: $ (यह) .सिरियालाइज़ (), सफलता: फ़ंक्शन (सफलता) {अगर (सफलता == 'Envio correcto') एन्टर ('अक्षम', झूठा);} और {console.log ('त्रुटि एन एल एंवियो'); $ ( स्वयं) .फंड (': सबमिट')। Attr ('disabled', false);}}});    

AWK -Print the next to last field of each line of input file -


I have an input file file, of which it is constantly updated with different fields, what do I try to do Print a new file next to the previous fields of each row of the input file: awk '{print $ (NF-1)}' outputfile

error: and awk: (FILENAME = - FNR = 2) Fatal: Attempt to reach Area -1

Need Help Thanks in advance

Someone Hild (the empty rows, or all white space) is on a line with NF 0, so that $ (- 1) to evaluate . In addition, if there is only one field, your code will print out $ 0 which you probably will not want.

  awk 'nf & gt; = 2 {Print $ (NF-1)} ''    

ubuntu - rvm init.d script -


I currently have Ruby 1.8.7 setup with rvm. Currently everything is working with rvmsudo, although I need the following init.d script which can run: rvmsudo / var / rails / sandbox / script / server -p 8080 -e sandbox < P> Unfortunately rvmsudo part is making it difficult because anyone does not recongize root rvmsudo any ideas on how can this init script write?

Use its full path: / path / to / rvm / bin / rvmd < / Code>

java - How to record a click event for an image acting as a button in Selenium? -


In my application, I got a button in the form of a button. When I record button click event in Selenium IDE and run it again, I only run it back, but click event is not actually submitting values ​​

Ex: submit button ( Which is an image) must actually be submitted for the database value but when I check in the database, the value is not added to it

element value

  & lt; Input Width = "98" vspace = "3" type = "image" height = "15" border = "0" id = "image 1" src = "image / butt_submit.gif" value = "submit" name = " Submit "& gt;   

selenium code

  selenium Click ("// input [@ id = 'Image1'] "); Selenium.waitForPageToLoad ("30000");   

Please help

thank you!

HG

The issue is not with the click on the Selenium / IDE image The code you are using (in HTML) will not submit form data, even if you did it manually. Have you checked in earlier?

However, if you want to use image as submitted submit for a form, onclick Event to submit the form for the image. See for form.submit :

  & lt; Html & gt; & Lt; Top & gt; & Lt; Script & gt; Function form submission () {document.getElementById ("frm1"). Submit (); } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form id = "frm1" action = "form_action.asp" & gt; First name: & lt; Input type = "text" name = "fname" & gt; & Lt; Br> Last name: & lt; Input type = "text" name = "lname" & gt; & Lt; Br> & Lt; Input type = "button" onclick = "formSubmit ()" value = "submit form" & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

They are using a button here but you can use it for your image.

More about HTML form basics:

c++ - FreeType error when building in XCode -


First of all, the previous story:

I do not know what is doing.

A lie speaks, I know what I am doing. I compiled I am a web developer, so the code to see what all the mistakes, but to try to use Xcode is a new book for me anyway, I designed a game that using Sfmel on Windows in C + + And now we're trying to get it into OS X (I'm just one of the groups with a Mac).

Execode 4.6.1 and SFML 2.0 I'm trying to create this damn application, and it's not a headache yet. The current situation of getting this thing to work with makes no mistake, but the construction stops and this shows is not so bad:

  dyld: Library not loaded: @ executable_path / .. /Frameworks/freetype.framework/ versions / a / referenced freetype: / users / Eric / Library / developer / Xcode / DerivedData / Test haconqzbewevbwgukppsacykkpml / Construction / Products / debug / Testkapp / Content / Frameworks / sfml-Graphics Structure / Version / 2.0.0 / sfml- graphics reason: Incompatible library version: sfml- graphics or later is required 17.0.0, but freetype version offers 16.0.0   

I just do not understand this mistake. I have the most advanced version of FreeType. I am also not sure that the version number 2.4.11 is in reference to considering the freestyle. I can not find this error any more, any ideas?

The error message refers to the library's compatibility version This is a version number Which is cooked in the dynamic library given at that time when it is made. Is linked against a binary library, compatibility version LC_LOAD_DYLIB load command which is copied to the runtime which tells dyld on the need to load dynamic libraries is. If a library is loaded by dyld , the compatibility version is checked and if the version of the program is more than that version of the library, it is an error.

When you run Otool -L freetype.framework / Versions / A / Friple you will see that it 16.0.0 as its compatibility version of the report < / Code>. If you do it sfml-graphics.framework / versions / 2.0.0 / sfml-graphics run it 17.0.0 report compatibility version for you to see if the Is freetype.framework . So you're hitting the error case described above.

The most common reason for such an error is that you created an old version of a workflow version that you created, and any related frameworks, against Note that in this sense the "old" refers to the compatibility version and no other version number associated with the framework (for example, the marketing version).

Without knowing the origin of the two structures involved (for example, if you make them yourself, or from where you receive binaries), it is not absolutely clear that you went wrong Are there. I will however note that the SFML GIT repository appears with the appropriate compatibility version ( 17.0.0 ), so if you are using a binary of sfml-graphics.framework SFML is provided by the people, then it may be your solution to choose their freestyle structure.

java - I want to create a method in my enumeration? -


मैं एक toString विधि को अपने CustomerType गणन में जोड़ना चाहता हूं। मेरा क्लास एक System.out.println () छूट प्रतिशत संदेश देता है अगर मेरी cutomerType पर निर्भर करता है, जो अब है .20 क्योंकि यह ग्राहक है टाईप कॉलेज मैं एन्यूमरेशन के लिए नया हूँ और मैं अपनी गणना के लिए एक toString विधि जोड़ना चाहता हूं जो ग्राहक प्रकार के आधार पर "कॉलेज ग्राहक" प्रिंट करता है। क्या इसको पूरा करने में कोई समस्या है? क्या वास्तव में मैं गलत कर रहा हूं?

मेरी कक्षा सुनें:

  import java.text.NumberFormat; पब्लिक क्लास ग्राहक टाईप ऐप {सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [] एआरजी) {// एक स्वागत संदेश सिस्टिम। आउट.प्रिंटलाइन ("ग्राहक प्रकार परीक्षण आवेदन में आपका स्वागत है \ n"); // ग्राहक प्रकार डबल ग्राहक = getDiscountPercent (CustomerType.College) के लिए डिस्काउंट प्रतिशत प्राप्त करें और प्रदर्शित करें; संख्याफ़ॉर्मेट प्रतिशत = संख्याफ़ॉर्मेट.जेटपरेंटस्टाइन (); स्ट्रिंग प्रदर्शन = "छूट प्रतिशत:" + प्रतिशत। प्रारूप (ग्राहक); Println (प्रदर्शन); } // एक विधि जो कि ग्राहक टाइप की गणना सार्वजनिक स्थिर डबल प्राप्त करेंडिसक्वैंटप्रिंट (ग्राहक टाईप सीटी) {डबल डिस्काउंट = 0.0; अगर (सीटी == ग्राहक टाइप। आरएसएस) छूट छूट = .10; Else अगर (सीटी == ग्राहक टाइप। कॉलेज) डिस्काउंट छूट = .20; और अगर (सीटी == ग्राहक टाइप। ट्रेड) डिस्काउंट छूट = .30; वापसी छूट प्रतिबन्ध; }}   

और यह मेरी गणना है:

  सार्वजनिक enum ग्राहक टाइप {रिटेल, ट्रेड, कॉलेज; सार्वजनिक स्ट्रिंग टूस्ट्रिंग () {स्ट्रिंग एस = ""; अगर (this.name () == "कॉलेज") s = "कॉलेज ग्राहक"; वापसी एस; }}    

Enums एक ही स्थान पर स्थिर डेटा रखने के लिए काफी शक्तिशाली हैं I आप ऐसा कुछ कर सकते हैं:

  सार्वजनिक enum ग्राहक टाइप {रिटेल (.1, "खुदरा ग्राहक"), कॉलेज (.2, "कॉलेज ग्राहक"), व्यापार (.3 "व्यापार ग्राहक"); निजी फाइनल डबल डिस्काउंट अप्रचलित; निजी अंतिम स्ट्रिंग विवरण; निजी ग्राहक टाइप (डबल छूट प्रचलित, स्ट्रिंग विवरण) {this.discountPercent = discountPercent; This.description = वर्णन; } सार्वजनिक डबल getDiscountPercent () {वापसी छूट प्रचलित; } सार्वजनिक स्ट्रिंग getDescription () {वापसी विवरण; } @ ओवरराइड सार्वजनिक स्ट्रिंग टू स्ट्रिंग () {विवरण का विवरण; }}    

loops - Java, make sure objects are being deleted when removed from arrayList -


Let's say I'm removing the "dead" object called "anime".

Use something like this:

 for  (int i = 0; i   

The object is removed after being removed from the ArrayList? Or "this"? I'm primarily doing C ++ code and garbage collection confuses me.

By any means can I see whether the objects are being removed or not by the garbage collector?

Thanks

wix - how to change from per user to all user installation? -


For our MSI, we have not mentioned all the user properties in the current release, so by default it runs according to user Gaya.

Our customers installed the application using the Admin User ID and the administrator left the company. Therefore its user ID is not high in a valid position.

They are unable to migrate to the new version using another admin account (as per the user's order).

However, we can change our MSI to support all users, it will not work in migration (major upgrade)

It seems that when we offer a new release If no existing releases are supported, we can fix this issue.

Is there any other alternative solution, even if the last MSI per user, now it should be upgraded primarily?

We are using WIX 3.5 for our installation process. Unfortunately, the Windows installer does not support the "upgrade in all contexts" as you have a copy of

The machine package can not upgrade a per-user package and a per-user package can not upgrade the per-machine package.

You can write an executable that finds an old .msi and uninstalls them to search for products and then to remove :: msiConfigureProduct () such as APIs :: Using MSENM Reloaded Products () However, without a user account, I am not sure that you will be able to see the products installed per-user.

asp.net mvc - What is loose coupling? -


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

  • 13 जवाब

    मैं कुछ अवधारणाओं का अध्ययन कर रहा था एमएसडीएन पर एमएसडीएन , और मैं उस बिंदु पर पहुंचा जहां उन्होंने एक शब्द "एमवीसी के तीन मुख्य घटकों के बीच ढीले युग्मन" लिखा है

    मैंने Google पर ढीली युग्मन के बारे में बहुत कुछ खोज लिया लेकिन मुझे हर बार विभिन्न प्रकार के उत्तर मिलते हैं

    यहां तक ​​कि मुझे एक नया शब्द तंग युग्मन और तंग एकता मिला।

    क्या कोई भी शब्द ठीक से परिभाषित कर सकता है, और यह क्या है बिल्कुल ठीक है।

    मैं आपके जवाबों की प्रतीक्षा कर रहा हूं

    धन्यवाद।

    ढीला युग्मन केवल इस तरह से सॉफ्टवेयर लिख रहा है कि सभी आपकी कक्षाएं एक-दूसरे पर भरोसा किए बिना स्वतंत्र रूप से काम कर सकती हैं चूंकि आप एमवीसी का अध्ययन कर रहे हैं इसलिए मैं इसे ढीली युग्मन की अवधारणा को प्रदर्शित करने के लिए एक उदाहरण के रूप में उपयोग करूंगा:

    1) चुस्त युग्मन

    ASP.NET वेब प्रपत्र कसकर युग्मित हैं प्रत्येक .aspx पृष्ठ उस पृष्ठ के पीछे कोड पर निर्भर करता है जो एक दुःस्वप्न का स्वचालित परीक्षण करता है

    2) ढीला युग्मन

    ASP.NET MVC ढीले से युग्मित है तर्क को 3 भागों में विभाजित किया गया है:

    1. मॉडल - आपकी कक्षाएं और व्यावसायिक तर्क शामिल हैं
    2. देखें - मॉडल डेटा के आधार पर एप्लिकेशन UI प्रदर्शित करता है
    3. नियंत्रक - आने वाले यूआरएल अनुरोध को उत्तर दें और उचित दृश्य का चयन करें

      तीन भागों को एक दूसरे को प्रभावित किए बिना स्वतंत्र रूप से बदला जा सकता है और हम सिद्धांत के लिए धन्यवाद आसानी से जांच के लिए स्वचालित परीक्षण कर सकते हैं दृश्यों पर भरोसा किए बिना हमारे मॉडल।

android - How to set bar width using achartengine. My last bar is Squeezed out -


I have a barrette with 3 bars shown, three times displayed with different width. How to set the equal width for all bars?

This is a snapshot of my belt

Enter image details here

Please give any suggestions!

Any help would be appreciated!

It seems that you have 2 series of data in a series that contains 2 items and green color There is only one item in one. When there is only one item in your chain, it can mean the width of the bar using:

  renderer.setBarWidth (width);   

Another solution is to add at least two items to your series.

oop - Lua objects tables leaking between object instances, but not records -


I'm trying to learn Lua, so hopefully this is an easy question to answer. The following code does not work Variable shells between all instances of classes leak

  - [[- reference class. -]] - CxBR_Context = {} - Reference name CxBR_Context.name = "Reference name is not set" - Child reference list CxBR_Context.childContexts = {} - Create a new instance of a reference class function CxBR_Context: New Object (Object) = Object or {} - If the user does not provide a setetable (object, self), then the object does not provide itself .__ index = self return Object End - Child reference function CxBR_Context: AddChildContext (reference) table.insert (self .childContexts, Context ("Add Child Reference"). Context.name .. "to" ..self.name) end - [[reference 1 class. References CxBR_Context -]] - Reference 1 = CxBR_Context: New {name = "Context1"} - [[- Reference 1A class. Inherits CxBR_Context -]] - Context1A = CxBR_Context: new {name = "Context1A"} - [[- - reference 2 square] Inheritance CxBR_Context -]] - Contex 2 = CxBR_Context: new {name = "Context2"} - [[- - Test -]] - Reference 1 = Reference 1: New () - Example of context 1 class, make an example (reference 1.name .. "is" .. table .getn (context1.childContexts) .. "children") Context2 = Context2: New () - Create an example of reference 2 square prints (reference 2.name .. "is" .. table.getn (context2.childContexts) .. "children") context1A = Context1A: new () - reference Make an example of 1a class print (context1A.name .. ".. .. table.get N (context1A.childContexts) .. "Children") Reference 1: AddChildContext (context1A) - Add Reference to the Child as Reference 1A 1. Print (Reference 1.name .. "is" .. table.getn (context1. ChildContexts.) "Children") - The result is fine, 1 child has a print (reference 2.name .. "is" .. table.getn (context2.childContexts) .. "children") - why thin return 1, 0 should be   

I can fix my problem by changing the constructor function:

  - child reference list - CxBR_Context.childContexts = {} - a Reference class function CxBR_Context Create a new example: Create a new object (object) = object or {childContexts = {}} - if the user creates a setmable (object, self) self.__ index = self return object and   < P> does not provide my questions:  
  1. Is there any cleaner way to declare class variables like the first instance, so I do not need to include it in constructor?
  2. Why does CxBR_Context.name work, but do not table CxBR_Context.childContexts?

    1. No, I do not think so. You want each child to make reference items by creating your own child-related field.

    2. This works because you pass a table containing a name field for a new field. What you did here:

      Reference 1 = CxBR_Context: Create a new {name = "Context1"}

      • Field "with name" Set to "Contact 1"
      • Pass the table to the manufacturer
      • Assign a metaTable (original CxBR_Context table) to the table created in the first step [in the constructor].

        So basically, when you call Context1.name, you retrieve a field from the Context 1 table, which is the beginning of the constructor But when you index it with childContext and no such field exists (because you have created the "name" field only at the constructor stage), Lula appears in the __ Indac Table, which is CxBR_Context. The table is normal for all reference area objects.

        Edit:

          object = object or {childContexts = {}} - create an object if the user does not provide one   

        Actually, this This will not work if you supply your table like this:

          Context1 = CxBR_Context: new {name = "Context1"}   

        This will work only if your object's availability is zero, then it is if you call the constructor with the parameter itself.

php - Query to convert from datetime to date in zend framework 2 using table data gateway -


I just want to draw only dates from a datetime column in zend framework 2. I wrote it like this -

  $ select-> Where-> Middle ('date (views_logs.date)', '2013-01-01', '2013-03-31');   

To get the following results in the query.

  where date (`visual_logs` .`date`) '2013-01-01' and '2013-03-31'   

but this work Do not Generate Parasensis and Casting Is No Can I Help Writing Date Casting in Zend Framework 2?

I think you have to use expression there

  $ Choose- & gt; Where-> '2013-01-01' and '2013-03-31' ") between AddPredicate (New \ Zend \ Db \ Sql \ Predicate \ Expression (" Date (visible_logs.date) ");   

What error are you getting?

Reading a log file in java which in currently being written -


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

  • 4 जवाब

    मेरे पास एक प्रोग्राम चल रहा है जो लिखते हैं कि एक फाइल में लॉग इन करें और मैं लाइन से इसे लाइन पढ़ना चाहता हूँ मैंने InputStream का उपयोग करने की कोशिश की, खासकर DataInputStream , इसकी उपलब्ध विधि का उपयोग करके लेकिन फिर इसमें readLine विधि नहीं है, इसे नापसंद किया गया है और इसे BufferedReader में readLine का उपयोग करने के लिए इसे लपेटने का सुझाव दिया गया है। लेकिन जब मैं BufferedReader का उपयोग करता हूं तो यह सभी पंक्तियों को नहीं पढ़ता है, यह किसी भी तरह से एक पंक्ति को पढ़ने से रोकता है।

      सार्वजनिक शून्य पढ़ें (DataInputStream ins) {try {while (सच) {if (ins.available () & gt; 0) {// BufferedReader रीडर = नया BufferedReader (नया InputStreamReader (INS)); //System.out.println (reader.readLine ()); Println (ins.readLine ()); } और {थ्रेड। नींद (200); }}} पकड़ (अपवाद ई) {e.printStackTrace (); }}   

    इसलिए, कोड ins.readLine () के साथ काम करता है, लेकिन इसे नापसंद किया गया है और जावा प्रलेखन के अनुसार यह BufferedReade आर। लेकिन reader.readLine () के साथ यह उम्मीद करता है कि यह काम नहीं कर रहा है।

    इसके अलावा, यह करने के लिए जो अन्य बेहतर जावा तरीका है, क्योंकि मुझे यकीन है कि यह कुछ मानक समस्या है। मैं ट्रेलर वर्ग के बारे में कहीं पढ़ता हूं। लेकिन यह परीक्षण करने में सक्षम नहीं है।

    से

    चाल एक java.io का उपयोग करना है RandomAccessFile, और समय-समय पर जांचें कि क्या फाइल की लंबाई अधिक है कि आपकी वर्तमान फ़ाइल स्थिति। यदि यह है, तो आप डेटा पढ़ा। जब आप लंबाई मारा, तो आप प्रतीक्षा करें धोने, कुल्ला, दोहराने।

    आप पारस्परिक बहिष्कार के साथ सौदा करने की आवश्यकता होगी (हालांकि केवल एक ही बात एक समय में पढ़ सकते हैं या आपके डेटा को भ्रष्ट किया जा सकता है)

    यदि आप एक बफ़रेड रीडर का उपयोग कर रहे हैं, तो यह एक समय में एक पंक्ति में पढ़ता है। यदि आप एक से अधिक में पढ़ना चाहते हैं, तो आप ऐसा लूप का उपयोग कर सकते हैं:

      BufferedReader br = नया BufferedReader (नया FileReader ("file.txt")); जबकि ((sCurrentLine = br.readline ()) = नल) {System.out.println (sCurrentLine); }   

    यह एक आईओएक्सेशन फ्इआई का कारण बन सकता है इसलिए इसे कोशिश / कैच में लपेटें या अपनी विधि को फेंक दें और इसके साथ सौदा करें।

    स्रोत:

c++ - How can I get an MFC application to block from the command line? -


I modified an MFC instance for OpenCascade, by adding some functionality (it was HLR example).

Uses document / visual architecture, while working most of the document class.

Some newer functions do not require a GUI, so the program exits before opening the GUI, which I do Quit (0) by calling CDcast expertise.

My problem is, for our workflow, the MFC application will be called from the Windows Command Line as soon as it is called, it gives back control over the armor and moves happily in the background, even if Whether it opens the GUI or not What I need to do is block the command line, even if the GUI is open or not.

I am reading on CWINAP and CMDFromameed, but if you can make your application block from the command line, I can not understand how to do this.

You can not EXEs are marked as either the console or the Windows program and This Windows program controller is handed over to Windows Manager and keeps the console running.

Your best bet is to have a small console app that calls the build process to launch the Windows app and then simply press on the HP process handle to end it. Waiting object .

Why is it not possible but more technical information is available on The Old New Thing Blog here:



c# - How to detect High CPU and long response time issues with Asp.NET Web Api -


We are running ASP.Net WebApi on the back of HAProxy 3 HAProxy distributes requests in randomly in these 3 instances is.

These examples link to the Mongodb, Radis and some window services.

Generally, w3wp.exe uses the% 30 CPU on each API server.

From time to time (sometime in one hour), API decides to use a higher CPU than the server. Regarding this behavior, we begin to see increasing response times. As long as HAProxy does not see 10000 seconds response time and these number increases until the decision of the route requests for the other two servers are all in 10-20 seconds. After some time, this server goes back to its normal position. And is starting to request again. After a few minutes, another server does the same thing, it keeps on running and continues.

We are using new remnants but since the app is a web API application, we have not found any useful information. We monitor all our servers (radices, manga and windows services) for CPU usage, memory usage, network traffic and I / O, but we do not see any significant load during the above outage.

How can we find out the reason behind the behavior of this application?

A good alternative would be to use something like mini dump Explorer and then WinDBG or otherwise Inspect with, what are the threads to see and further forward. I have a good blog post that can do it here:



c# - How to select multiple items from contextMenuStrip -


I am working on the C # winForm project which uses the context menustrip only to select one at a time ToolStripManu I want to explain how to disable / override the default behavior of allowing item. I have been working on this for the last two days and I am progressing to 0.

Anyone know of any link or how to do it?

Thank you in advance, - DA

Here are some code which is one of our projects Which is probably found by you later on. It came out of a mousedown handler, I think the key is setting the property on every ToolStripMenuItem checkonClick property, so you can feel it In the closing event and set E.Cancel = true :

  if (e.button == MouseButtons.Right) {ContextMenuStrip MStrip = new ContextMenuStrip (); MStrip.Closing + = New Toolstep DopDownCloseAventHandler (mStrip_Closing); Foreach (control cntrl. Control in this) {ToolStripMenuItem itm = New ToolStripMenuItem (); Itm.Text = cntrl.Text; Itm.CheckOnClick = True; Itm.Checked = cntrl.Weight; MStrip.Items.Add (itm); MStrip.Show (this.PointToScreen (new dot (_mouseX, _mouseY)); }} Private Zero mStrip_Closing (Object Sender, ToolStripDropDownClosingEventArgs e) {if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked) e.Cancel = true; }    

java - Mock a private method of the class under test in JMockit -


In my class exam (CUT) - an ejac - I have a personal method "getConnection" I cut any other I want to test the method, but this method will fail before hand.

I showed it below, but the "invoke" is wrong. I do not want to call this method, I want to stub it. but how? ('Connection' is a stub)

  New Non-Strike Expectation () {{Avoc (Archived Bean, "Matching Connection"); Result = connection; }}; ArchivingBean.moveCreditBasic2Archive (New Date ());    

Your test is correct, except that it opens an announcement for . EJB class, in this case.

Generally, jokes are fun in complete (all methods). In such cases, you will declare a @Mocked MyEJB archivingBean parameter in the test method, for example.

For fun partial , on the other hand, you use the NonStrictExpectations (Object ...) constructor, such as:

  New Non-Strike Expectations (Collections Bean) {{// //    

How to accept tcl bitmaps list -


Is there a way to get a list of Betamap images that come with TCL distribution by default?

I have found a wiki page related to this question but it uses pre-prepared bitmap list

Bitmap images (unlike bitmap , which you should protect if you can) Image vs bitmap And this filtering can be listed by image image type :

  proc listBitmapImages {} {set bitmap {foreach im] Image names] {if {[image type] help  $ im] eq "bitmap"} {lappend bitmaps $ im}} return bitmap}   

Note that the not bitmap image per second (Some default bitmap , as listed on the Tk_GetBitmap manual page, but they no are otherwise searchable and are saved from the new one If all is possible, their portability is also very scary in the first place, and the main thing is that you can use them to lay down canvas items. Can choose an option to do T is actually portable.)

c - Finding out if a binary file has been compiled with stack smashing protection -


On Linux, there is no way that the state binary file has been compiled from the stack-Spasing ON / OFF command line? Is

I'm pretty sure that I have security, but only for the reason, I would like to write some tests for your Baynerijh, if ever comes a day when everything went wrong and some of the reasons Security closes.

If you have your own executable file format Elf and < / Em> has been compiled such as GCC v4.3 or greater, which only happened -frecord-gcc-switches command line switch, you can do the following:

  $ gcc -frecord-gcc-switches -fno-stack- patrons test.c $ readelf -p .GCC. command.line a.out section '.GCC.command.line' string dump: [0] -imultiarch x86_64-linu-gnu [1d] test.c [24] - Mtune = generic [33] -marc = x86- 64 [41] - Frecord-gcc-switches [57] -fno-stack-protector   

When < strong> GCC and -frecord-gcc-switches has passed switch, it .GCC.comment.line will add section - GCC - Switches sent to binary ELF

You

Unfortunately, this solution is confined to the compiled binary files using - to determine whether stack-smashing turn on / off what binary files To determine, it has been compiled with Fno-stack-protector switch. Frecord-gcc-switches - Which effectively means that it is useless for most situations, although maybe you can get luck in your special case.


It is worth mentioning that buffer overflow vulnerabilities in binary files is an active field of research, for example, here one.

See also



Can't read native C++ BYTE * in VB.NET -


I'm trying to read passport information in a reader (Marjed) which uses CE 6 net. Seller API C + +

  is went to type // [C +] Taipingfes Int (* CRXCALLBACK) (byte * Perekbf, Anditalen Int); Ent Fare Pascal Exports CRX Open (CRX Klackack LPDTAQ); The   

This is my VB.NET implementation

  '[VB.NET] Public Class CRX public representative function CRXCALLBACK (ByVal pRecvBuff System.IntPtr, ByVal Form NDataLen as integer) integer & lt; DllImport ("Mrz.dll", entrypoint: = "CRX_Open", SetLastError: = true) & gt; _ Public Shared Function CRX_Open (ByVal lpDataCallback CRXCALLBACK as) class as integer End Function   

Finally a form

  private sub CRX_Load (ByVal As a system, Object, By as an E-system. Avent Aggers) MyBase handles. Load if CRX.CRX_Open (on Misses Reader Callback) & lt; & Gt; CRX_ERR_SUCCESS Then MessageBox.Show ( "CRX_Open Failed") End Sub Private Function MrzReaderCallback (ByVal pRecvBuff as System.IntPtr, ByVal nDataLen string as integer) as Dim str As Integer = Marshal.PtrToStringUni (pRecvBuff) MsgBox (STR) try to catch former exception MsgBox (ex.Message, MsgBoxStyle.Critical, "error") end return try CRX_ERR_SUCCESS   

but when I Using martial pRecvBuff content. PtrToStringUni (pRecvBuff, nDataLen) Returns are not readable to me characters

There is no suggestion for me, what am I doing wrong?

Relationship

Evan

Expect buffer (< Code> IntPtr ) to include a unicode string comprising a byte array.

If C + + API was not using Unicode, you may need it or in its replacement.

Disabling Button Javascript and C# -


I have a call in my code that looks like this:

  bool isQtyValid = True; Boole disabled = false; External (parameters) {// If setting isQtyValid (IsQtyValid!) Disabled = true; Page Client script. Registry startup script (this .gateType ()), "function", string.format ("SetBootenStatus ('{0}')", disabled.tostring (.) Toolware ()), true); }   

Then my javascript looks like this:

  function setButtonStats (disabled) {var bb = document.getElementsByClassName ('buttonSubmit'); For some reason (var i = 0; i & lt; bb.length; i ++) (BB [i] .disabled = disabled;}}   

For some reason this is only one The path will work. If it is set to disabled = true, then it will not go back to being enabled, and if it is set to disabled = false, then it will not go back to being disabled. Whether it is being set correctly or not, and it changes the false and false truth from the right when it should be, but this button changes the disabled status

Do I have some small things that you can see?

Thanks for any help, you can give me.

> ) > "SetButtonStatus ({0})" // < - SetButtonStatus (true)

java - Error with self-bootstrapping Ant build -


I am trying to write an ant build which is not I need to add anti-plugins Is the ant Lib's directory, or / home / mysuser /. Ent / Lib , or in my Eclipse example Ent Home, etc.; That is because I can finally build my project on a host Jenkins server, where I do not have access to the system's ant establishment.

I'm calling it "self-bootstrapping" building, because I use IVs

The aura of my creation (using the plugin as an example: & lt; path id = " Build.path "& gt; fileset dir =" $ {Lib.buildtime.dir} "includes =" ** / * .jar "/> gt; & lt; / path & gt; ; ; lv; ivy: resolution file = "$ {ivy.xml}" /> gt; iv: pattern = "$ {gen.lib.main.dir } / [Artifact] - [amendment] Receive. [Ext] "conf =" main "/> & lt; iv: pattern =" $ {gen.lib.test.dir} / [artifact] - [amendment]. [Ext] "conf =" test "/> & lt; IV: get pattern =" $ {gen.lib.buildtime.dir} / [artifact] - [amendment]. [Ext] "conf =" buildtime "/> & lt; IV: report todir =" $ {gen.staging.dir} "/> & lt; iv: cache path path =" build.path "conf = "Buildtime" /> gt; target name = "taskdefs" depend = "solved"> gt; troubleshoot resource = "/ net / sf / extradib / entrleb" XML "URI =" Antibyl: Net SF. Antarbib "classpathref =" build.path "/> & gt; Property name =" Fajj "value =" discussion "/> gt; antcontrib: if & gt; ; & Lt; antcontrib: par arg1 = "$ {fez}" arg2 = "buzz" /> gt; antcontrib: then> echo message = "fuzzy buzz!" / & Gt; & lt ; / Antcontrib: then> gt; antcontrib: and & gt; & lt; echo message = "fuzz is not buzz!" / & Gt; & lt; / antcontrib: and & gt; & lt; / antcontrib: If I run the taskdefs target, then my entry output will be done if & gt; & lt; / target & gt; & gt; Project & gt;

In an echo " Fuzzed ! "Instead of seeing the message, I get the following error:

  build failel / home / menu / deception / workspace / map / build.xml: 169: problem: work or type Failed to create antible: net.sf.antcontrib: If the reason: Name is undefined Action: Check spelling Action: Check that any custom works / types have been declared Action: Check that any & lt; presetdef & Gt; / & lt; macrodf & gt; declarations have taken place in this namespace E type or functions have not been defined, but this is an antibab declaration. Action: Check that the implementation library exists in one of: - / home / myuser / eclipse / plugins / org.apache.ant_1.8.3.v201301120609 / Lib - / home / myuser / .ac / lib -a directory has been added to the command-line with LB logic   

What am I trying to do (recommended above To avoid doing 1 out of 3) is impossible? If so, why? If not, in my setup Thank you in advance!

I would normally create a single "bootstrap" target and use it To install Ivy "$ HOME / .ant / lib" directory < In the end, it is a shame that Ivy has an ANT Is not packaged with default. If you search for your hosted service then prevent you from copying files to the Home directory, then the easiest thing is to send a copy of Ivy Jar with your source (and enable it using the workforce)

Update

Use the following taskdef for ant-contrib:

  & lt; Taskdef uri = "antlib: net.sf.antcontrib" classpathref = "build.path" />   

Update the requirements In recent times the library was redistributed as one at some level.