Sunday, 15 April 2012

ruby on rails - Sidekiq worker not able to write to database or log file -


I am creating an app on Herokou and Redis which sends an SMS message to an input CSV file for each line In which the mobile phone number The message has been sent down to a sidekick worker using the twilio. The problem is that even if the SMS is being sent for all the rows in the CSV, write the database ( TextMessage.create) and logs written ( puts statements) Only in CSV there is a sidekick worker created for each line in the CSV file for the A line. It seems that only one sidekick worker has I / O (DB, file) access and it locks it with other sidekick workers. Any help would be appreciated.

Sidekick Worker:

  'sidekiq' is required 'tileio-rb' class texceptions & lt; ActiveRecord :: Base included Sidekiq :: Extensions def self.send_message (number, body, ROW_INDEX, column_index, table_id) "TextMessage # send_message: row index: # {ROW_INDEX} column index: # {column_index} TableID: # {} Table_id body: # {body} phone: # {number} "tileio :: configuration setup: account_sid = & gt; 'Vague' ,: auth_token = & gt; '& Lt; Unclear & gt; ' Sms = twilio :: sms Create: from = & gt; Number, = to = & gt; '+17085555555' ,: body = & gt; Body + '| Sent: '+ Time.now.in_time_zone (' Central Time (US & Canada) '). Striptime ("% m /% d /% Y% I:% M% p central") TextMessage.create: to = & gt; Number, = to = & gt; '+17085555555' ImportCell.add_new_column (table_id, ROW_INDEX, column_index, "Time to Sent", Time.now.in_time_zone ('Central Time (USA & Canada)'.) Strftime ("% M /% d /% Y% I:% M% p Central ")) End end   

Call the sidecake worker:

  TextMessage .delay_until (time_to_send,: GT retry = &, 3) .send_message (Phone, 'scheduled:' + time_to_send.in_time_zone ('Central Time (USA & Canada)') strftime ("% M /% d / % Y% I:.% M% P central "), line_index, column_index, table.idem column_index + = 1   

Worker: Bundle Exclusive Sidekick -C Config / SideKeak.IML

< Code> Sidekick.IML

 : verbose: false: concurrency: 3: line: - [default, 5]   

config / initializers / redis.rb :

  uri = URI.parse (ENV ["REDISTOGO_URL"]) REDIS = Redis New (: host = & gt; Uri.host ,: port = & gt; Uri.port,: Password = & gt; Uri.password) Sidekiq.config Ure_server do | Config | Database_url = ENV ['DATABASE_URL'] If (database_url) ENV ['DATABASE_URL'] = "# {database_url}" pool = 25 "ActiveRecord :: Base.establish_connection End End    < P> 

I am one of those people who commented on your question, just decided it!

You're using .create which sidekick did not look like this, so I tried. New and used again. I think what to do with it. The thread is not being compressed or some kind of safe, but I honestly do not know anything.

Non-working code:

  Class Hardwalker Sidekick :: Worker def (name, count) display 'some are working hard!' UserInfo.create (: user = & gt; "any",: misc1 = & gt; 0 ,: misc2 =>,: misc3 ​​= & gt; 0 ,: comment = & gt; "created from hardworker ",: Time_changed = & gt; time.) Now 'done with hard work'! Working Code:  
  Class Hardwalkers include Sidekick :: Worker Diff (name, count) 'Some work hard!' A_row = UserInfo.new (: user = & gt; "any",: misc1 =>,: misc2 =>, misc3 ​​=> 0 ,: comment => "hardworker Created from ",: time_changed = & gt; time.nah) 'a_row.save' with hard work! ' End End    

c# - Calling SignalR client from webfarm -


मेरे पास निम्न संदेश परिवहन परिदृश्य हैं

क्लाइंट - & gt; कॉल्स सिग्नल आर - & gt; कॉल एसससेरसबस - & gt; आंतरिक रूप से प्रक्रिया संदेश - & gt; परिणाम के साथ NSVERBus गेटवे सेवा कॉल - & gt; सिग्नल आर हब कॉल - & gt; परिणाम के साथ क्लाइंट को अपडेट करता है।

सिग्नल आर बनाम लंबी मतदान का चयन करने में मुझे यह जानने की जरूरत है कि सिग्नल आर पैमाने पर है। तो मेरा होमवर्क करने में मुझे एज़ूर सर्विस बस पर सिग्नल आर पर आया। यह सेटअप ग्लोबल.एएसएक्स एप्लिकेशन स्टार्ट पर किया जाता है।

अंततः मुझे यह करने में सक्षम होना चाहिए, एक NServiceBus हैंडलर के अंदर से:

  var context = GlobalHost ConnectionManager.GetHubContext & LT; MyHub & gt; (); context.Clients.Group (समूह) .addMessage (संदेश);   

सवाल यह है कि क्या संदर्भ को ढंक दिया जाएगा, क्योंकि मैं संभावित रूप से इसे दूसरे मशीन से फोन कर रहा हूं, जो ग्राहक से जुड़ा था?

इसके अलावा सिग्नलआर का कार्यान्वयन विषय को बीज के लिए उपयोग करने वाली शेनेशन स्कीमा क्या है? मुझे पता है कि मैं इसे एन-नंबर के विषयों का उपयोग करने के लिए कॉन्फ़िगर कर सकता हूं, लेकिन यह वास्तव में यह निर्धारित करने के लिए कि किस विषय पर कौन सा संदेश जाता है और यदि यह बाहरी कॉलर पीओवी से प्रासंगिक है।

आप GlobalHost.ConnectionManager.GetHubContext का उपयोग किसी भी अनुप्रयोग में करने में सक्षम होना चाहिए जहां आपने पंजीकृत किया है ServiceBusMessageBus जैसा आपकी IMessageBus सिग्नलआर के माध्यम से ग्लोबलहोस्ट। डिपेन्न्सी रीसोलर । यदि आप GlobalHost.DepenencyResolver.UseServiceBus (...) आवेदन में कॉल करते हैं, तो यह आपके लिए किया जाता है।

यदि आप ऐसा करते हैं, तो एक संदेश Azure Service Bus addMessage पर प्रत्येक कॉल के लिए IHubContext पर GetHubContext से लौटा कोई अन्य हब विधि। यदि वेब फ़ॉरेस्ट में अन्य नोड्स से जुड़ा ग्राहकों का सब्सक्राइब किया गया है, तो अन्य नोड्स सर्विस बस से संदेश ले लेंगे और सब्सक्राइब किए गए क्लाइंट को रिले करेंगे।

जो विषय किसी संदेश को जाता है वह प्रासंगिक नहीं होना चाहिए एक बाहरी कॉलर की पीओवी से आप थ्रूपुट को सुधारने के लिए कई विषयों का उपयोग कर सकते हैं, लेकिन अधिकांश उपयोग मामलों के लिए एक पर्याप्त होना चाहिए।

यदि आप एक से अधिक विषय का उपयोग करना चुनते हैं, तो आप इस विषय के बारे में सोच सकते हैं कि एक संदेश अनिवार्यतः यादृच्छिक । एकमात्र ऐसी चीज जो गारंटी दी जाती है कि एक ही प्रेषक के संदेश समान विषय पर जाएंगे। यह सिग्नल आर को एक ही प्रेषक के संदेशों को क्रम में रखने की अनुमति देता है।

चेतावनी एपिटर: सिग्नल आर के पास अभी तक आधिकारिक रिलीज़ का समर्थन नहीं किया गया है। 1.1 संस्करण आधिकारिक रूप से पैमाने पर समर्थन करने के लिए पहली रिलीज होगी।

Facebook app creating a second group -


I am grouping with my FB app and inviting users to my app group, everything is fine first time. When I try to create another group, I get the following error: {"(OAuthException - # 4009) (# 400 9) This app can not add more groups until there is no more user"} < / P>

"... there are more users in it"? Is there a limit to the group that we can make?

When I first delete the group and after that I create another group, then everything works fine.

Can anyone help me with this problem?

Thanks in advance!

The number of groups your app can create is limited by the number of active users of your app.

Either add additional developer accounts to your app (so that they can become 'active users') or try adding some test users to do this.

android - Save bitmap to file -


I tried to apply the feature back and forth in the Android Fingerprint app. I have tried to use the code below.

Error

  03-26 20: 42: 12.020: W / Systems. Er (28056): java.lang NullPointerException 03-26 20: 42: 12.020: W / Systems. ARR (28056): On Bark Soft. FirstActivity.TextPEGFFile (FirstActivia.JavaN1) 03-26 20: 42: 12.020: W / Systems Er (28056): Baked soft.firstActivity.onOptionsItemSelected (FirstActivity.java.304)   

FirstActivity

  Public Boolean Onoptsim selected (MenuItem item) { Switch (item .getItemId ()) {Case RID. Tolls: ll.setVisibility (LinearLayout.VISIBLE); Back true; Case R.id.import_pics: getPhotos (); Back true; Case R.id.save: toJPEGFile (); Back true; Case R.id.trash: Trash (); Back true; } return false; } Private Zero JPEG File () {// Tudo Auto-Generated Method Stub String Root = Environment.Getensteinstorage Directories (). Toasting (); File myDir = new file (root + "/ saved_image"); MyDir.mkdirs (); Random Generator = New Random (); Int n = 10000; N = Generator. NXT (N); String fname = "image -" + n + ".jpg"; File file = new file (myDir, fname); If (file.exists ()) file.delete (); {FileOutputStream Out = Try New FileOutputStream (File); FinalBitmap.compress (bitmap.compress format.jpeg, 90, out); // Error 341 LINE out.flush (); Out.close (); } Hold (exception e) {e.printStackTrace (); }}   

I do not know where is the wrong. Please help me. thank you in advanced!

finalBitmap.compress (bitmap .compress format.jpeg, 90, out);

As you indicate, that is the error line.

The last billing map has not been initiated.

Alias, this is not a bitmap, it's a zero value. Make sure you load this bitmap first in this variable. finalBitmap = .... // Assign Final Bitmap FinalBitmap.compress (bitmap .compress format.jpeg, 90, out); // Then Save to File

Edit:

Reading from your comment, one way to do this is to, onDraw method :

  canvas.draw bitmap (bitmap, 0, 0, paint); FinalBitmap = bitmap;   

But again, it does not know where you are getting from bitmap, is it another global variable? Maybe you just final

php - How to detect position of mouse cursor in a div -


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

  • 14 जवाब

    मेरे पास एक आयताकार अवधि है 100 पिक्सल चौड़ा है और मैं उपयोगकर्ता को 0-100% से चुनना चाहता हूं।

    जहां भी वे चौड़ाई के साथ डिव में क्लिक करते हैं, वह वही मूल्य है जो सहेजा जाता है और उपयोगकर्ता को एजेक्स का उपयोग करके तुरंत दिखाया जाता है। इसलिए यदि वे div के मध्य में बिल्कुल क्लिक करते हैं, तो सहेजा गया मान 50% होगा।

    मैं ऐसा करने का एक शानदार तरीका नहीं सोच सकता हूँ! किसी भी सुझाव?

    & lt; इनपुट प्रकार = "श्रेणी" / & gt; & lt; span & gt;

    - एडिट -

    के साथ संयोजन के रूप में, Firefox के लिए फ़ॉलबैक समर्थन ब्लॉकक्वाइट>

    HTML अपने 100px चौड़े के अंदर सीमा रखें <कोड> & lt; अवधि & gt;
      & lt; div id = "console" & gt; ... & lt; / div & gt; & Lt; span id = "कंटेनर" & gt; & Lt; इनपुट आईडी = "मायरेन्ज" प्रकार = "श्रेणी" न्यूनतम = "0" अधिकतम = "100" / & gt; & Lt; / span & gt;   

    jQuery पर परिवर्तन () , मान के साथ कुछ करें:
      $ (फ़ंक्शन () {$ ("# MyRange ") पर ('परिवर्तन', फ़ंक्शन () {// मूल्य बाहर निकालना, #console DIV $ (" # console ") का html सेट करें। Html ($ (this) .val ());}); / / #console $ ("# myRange") का आरंभिक मान सेट करें। ट्रिगर ('परिवर्तन');});   

    सीएसएस & lt; span & gt; में रेंज चयनकर्ता छिपाएं, लेकिन अभी भी क्लिक को इसके मान
      #container {width : 100 पीएक्स; पृष्ठभूमि: # 333; } # कंटेनर इनपुट {अस्पष्टता: 0; }    

How do you make JQuery to load images on page load ? -


The code below works fine with 'mousemov', but I want to display images on page load, Nothing else that I have changed images are displayed on page load. Any help is greatly appreciated! Thanks Ian

  $ (document) .ready (function () {$ ("body"). Mousemove (function () {$ ("li.fsn-level-1") each. Child ("span") first () children ("img") length; if (IMGCount & lt; 2) {$ (this) children ("span"). ("Span") "" (")" ("& lt; img id = 'imgPlus' src = 'picture / plus' style = 'display: inline' / & gt;"); $ (this) ) First (). ("& Lt; img id = 'imgMinus' src = 'images / minus.png' style = 'display: none' / & gt;");} var closed = $ (this). HasClass ("closed"); var open = $ (this) .hasClass ("open"); var first =! Close & open; if (first) {$ (this) .removeClass ("Open") $ (find this ")" ("closed" (this) child ("span") first (). ("IMG [id = 'imgplus']"; if (plus. Lamp) (")" ("Img [id = 'imgMinus']"); if (minus.length) minus.hide (); } $ (This). Unbund ('hover'). Bind ('hover', function () {claus eAllSubMenu (); Var closed = $ (this) .hasClass ("closed"); Var open = $ (this ) .hasClass ("open"); Var first =! Closed & amp; Amp; Open! If (before || closed) {$ (this) .removeClass ("closed"); $ (This) .removeClass ("open") addClass ("open") Var sub = $ (this). Children ("ul"); If (sub. Langal) {sub. (;); } Plus plus = $ (this). Children ("span") first (). ("Img [id = 'imgPlus']"); If (plus.length) plus.hide (); Var minus = $ (this). Children ("span") first (). ("Img [id = 'imgMinus']"); If (minus.length) minus.show (); } If (open) {$ (this) .removeClass ("open") $ (this) .removeClass ("off"). AddClass ("Closed"); Var plus = $ (this). Children ("span") first (). ("IMG [ID = 'IMGPlus']"); If (plus.length) plus.show (); Var minus = $ (this). Children ("span") first (). ("Img [id = 'imgMinus']"); If (minus.length) minus.hide (); }}); });    

It's hard to see what you're actually trying to do, but This is what I found:

After the page is ready, you are adding images:

  $ (this). Children ("span") first (). Prepaid ("& lt; img id = 'imgplus' src = 'picture / plus page' style = 'display: inline' / & gt;"); $ (This). Children ("span") first (). Prepaid ("& lt; img id = 'imgMinus' src = 'images / minus.png' style = 'display: none' / & gt;");   

This will cause images to be loaded at that time on time, i.e.: you are waiting for the page to be ready (load), then you are adding them, and loading them Are forced to page after loading.

If you need to be dynamic (which looks like this), try it before calling $ (document) .ready (); In this way they will be included in the load for the document (and therefore whichever occurs later).

c - Optimizing the nested for loop -


  के लिए (n = 0; n & lt; L_SUBFR; n ++) {s = 0; के लिए (i = 0; i & lt; = n; i ++) {s + = exc [i] * h1 [n - i]; } Y1 [n] = s; }   

अनुकूलित संस्करण:

  के लिए (n = L_SUBFR; n! = 0; n--) {for (i = n; i! = 0; i--) {y1 [n] = y1 [n] + exc [i] * h1 [n - i]; }}   

मैंने दोनों कोड को AMD Opteron 6274 बिट मशीन पर gcc 4.4.6 के साथ संकलन के बाद चलाया है। हालांकि, I गति या निष्पादन समय में कोई भी लाभ देखने में सक्षम नहीं है I

(1) क्या कोई ऐसा तरीका है जो मैं उपर्युक्त कोड को और अधिक अनुकूलित कर सकता हूं?

(2) क्या कोई मुझे बता सकता है कि मैं लाभ क्यों नहीं देख पा रहा हूं?

आपको "तेज" कोड के बजाय पठनीय कोड बनाने पर ध्यान देना चाहिए। स्पीड अपने एल्गोरिदम को और अधिक कुशल बनाकर प्राप्त की गई है:

आप को त्वरित रूप से सरल तरीके से बदलकर अधिक प्रदर्शन प्राप्त कर सकते हैं, (i! = 0) कोड> (i)

कंपाइलर आपके लिए वैसे भी सभी करता है।


मैं अपडेट किए गए प्रश्नों के उद्धरण को पुनः लिखता हूँ

(1) क्या कोई तरीका है जो मैं उपर्युक्त कोड को और अधिक अनुकूलित कर सकता हूं?

ज़रूर, आप को बदल सकते हैं (i! = 0 ) और (n! = 0) के साथ (i) और (n) और सभी प्रकार के shenanigans और nitpicking के साथ यह कोड थोड़ा तेज करने के लिए, लेकिन अंत में, आप वास्तव में कुछ भी नहीं बदलेगा क्योंकि आपका कंपाइलर अधिक अनुकूलन करता है अक्सर, यह सीधे जनरेट किया गया विधानसभा को अनुकूलित कर सकता है।

(2) क्या कोई मुझे बता सकता है कि मैं लाभ क्यों नहीं देख पा रहा हूं?

संकलक मेरे दोस्त यहां तक ​​कि अगर कंपाइलर यहाँ कुछ भी नहीं किया है, आप नैनो दूसरे परिशुद्धता टाइमर है जब तक आप एक लाभ नोटिस नहीं जा रहे हैं अंततः, यह L_SUBFR की अपनी परिभाषा पर निर्भर करता है।


बस किक के लिए, यहां एक उदाहरण है कि संकलक क्या कर सकता है:

  अहस्ताक्षरित int i = getValue (); यदि (i & gt; = 10 & amp; amp; i & lt; = 200) {}   

ऐसा कोड जो कम से कम लगता है, इतना अपूरणीय है, इसे कंपाइलर द्वारा अनुकूलित किया जा सकता है: < / P>

  अहस्ताक्षरित int i = getValue (); यदि (i - 10 & lt; = 190) {}    

php - How do I parse a specific json data response? -


I was pushing my hair for the past few days.

I just want to parse a piece of data from the string response using the received method.

My PHP code I'm working with:

    

The results I get:

  {"data1": "value1", "data2": "value2", "data3": " I want to display "value3" only for my output, but I want to add the full string to "value3", "data4": "value4", "data5": "value5"}   

The response is getting.

If you want the data to be the key address (data 3 part) you can json_response_data json_decode :

  if ($ response_status == "200") {$ decoded = json_decode ($ json_response_data); Echo $ decode ['data3']; }    

java - How do I access instantiated WebSockets in Jetty 9? -


This is probably obvious, but I am new to this paradigm. I am creating a Jetty server and following my websacet class as follows Registering:

  server server = new server (8080); WebSocketHandler wsHandler = New WebSketchesHandler () {@Override Configure Public Zero (); factory.register (MyEchoSocket.class); }}; Server.setHandler (wsHandler);   

WebSut is recovering the message. Without getting the message before the client, I would also like to be able to send messages to the server. How can the MyEchoSocket instance be used when opening the connection? Or, more generally, how do I send a message to the socket outside the onText method in MyEchoSocket?

Two common techniques have been presented in a super-simplified chat room concept.

Option # 1: Revert the report of the websit to its central location

  @ WebSocket Public Class ChatSocket {public session session; Connect to Public Zero on @OnWebSocketConnect (session session) {this.Session = session; . Join ChatRoom.getInstance () (this); } @OnWebSocketMessage Lessons on public spell (string message) {ChatRoom.getInstance (). WriteAllMembers ("All Hello"); } Close public zeros on @OnWebSocketClose (int status code, reason of string) {ChatRoom.getInstance (). Part (this); }} Public Square ChatRoom {Private Fixed Last ChatRoom INSTANCE = New ChatRoom (); Public Stats ChatRoom getInstance () {return INSTANCE; } Private listing & lt; ChatSocket & gt; Members = new Arrestists & lt; & Gt; (); Public zeros included (chatset socket) {members.add (socket); } Public Zero part (chatset socket) {members.remove (socket); } Public Zero writing AllMembers (string message) {for (ChatSocket member: member) {member.session.getRemote () SendStringByFuture (message); }} Write a public null specific member (string member name, string message) {ChatSocket member = findMemberByName (memberName); . Member.session.getRemote () sendStringByFuture (message); } Public ChatSocketNetBarName (string username) {// reader left as exercise}}   

Then just use the central location to talk to your favorite website.

  ChatRoom.getInstance (). Write Questions ("Alex", "Hello"); // or ChatRoom.getInstance (). WriteAllMembers ("All Hello");   

Option # 2: WebSocket is created with WebSocketCreator

  @ WebSocket Public Class ChatSocket {public chat room chat room; Public Chatkets (chat room chat rooms) {this.chatroom = chatroom; } Connect to Public Zero on @OnWebSocketConnect (session session) {chatroom.join (this); } @OnWebSocketMessage Lessons on Public Zero (String Message) {chatroom.writeAllMembers (Message); } Close @OnSubasocket Close public zeros (int status code, reason of string) {chatroom.part (this); }} Public class ChatCreator WebSocketCreator {Private ChatRoom applies chatroom; Public chat creator (chat room chat room) {this.chatroom = chatroom; } Public Object createWebSocket (Upgrade Required Request, Upgrade Response Response) {// We want to create a chat socket and with our chat room implementation // want to return it to a new ChatSocket (chat room); }} Public Square Chathandler WebSocketHandler [Private ChatRoom chatroom = New ChatRoom ()) Expands; @ Override Public Wide Configurable (WebSocket Certificate Factory) {factory.setCreator (new chat creator (chat room)); }}   

At this point you can use the above technique to talk to your favorite web sites.

c# - Remove special characters from XmlCompiledTransform -


I am taking a DataSet , load it into XmlDocument I am trying to replace it with XSLT file and delete special characters from my output file.

Short code:

  DataSet ds = GetData (); // Question Database XmlDocument doc = New XmlDocument (); Doc.LoadXml (ds.GetXml ()); XslCompiledTransform trans = New XmlCompiledTransform (); Trans.Load ("myTemplate.xslt"); XmlTextWriter Author = New XmlTextWriter ("C: \ output.xml", encoding. GetEncoding ("ISO-885 901")); Trans.Transform (doctor, blank, author); Writer.Close ();   

XSLT header

  & lt ;? XML version = "1.0" encoding = "ISO-8859-1"? & Gt; & Lt; Xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/XSL/transform" & gt;   

I thought it was to do with encoding only, this is the reason I got the encoding. Gate encoding ("ISO-885 9-1") was put there, although I may have to be wrong, in particular, I have to remove characters from the output like I®. If this is not an encoding, then is there any way that I can exclude these characters?

You can try using Regex to remove all special characters < Public static string RemoveSpecialCharacters (String Specialists) {Reggae Reggae = New Reggae ("(?: [^ A-z0-9] | (? & Lt; = ['\"]), "RegexOptions. IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled); Return regex.Replace (Special Characters, String.Empty);}

Just adjust your code so that you keep some special characters Which you should

Android Viewpager OutOfMemoryError Fragment -


Where each page is a piece with a different image set in the background as I need to make sure that the scroll For easy intervals, I have set the offscreenpage 20 (the number of items in the viewpages), but I am getting this error many times:

  java.lang OutOfMemoryError: Size of bitmap VM budget exceeds   

I already maximize images Compressed JPEGS), any ideas how can I solve this problem?

There is a good article in the training section of the Android Developers site ... ... it shows you How to use caching mechanisms in Android applications. You can adopt it in your ViewPager implementation.

objective c - objc object pointing -


I am trying to access an object in an implementation file where the method looks like this: - ( Boolean) Human ISLiv: (ID) manpower; However, Xcode complains that such an object is not present and the construction fails.

In the main file, main.m , I type it in the main () function:

  int main (Int argc, const char * argv []) {NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] INS]; Human * human = [[human alloted] init]; MyHuman * myhuman = [[MyHuman alloc] init]; [Make humans: @ "John Doe" age: 25]; If ([human human is Live: Myhuman]) {NSLog (@ "% @ is alive and well.", Myhuman.humanName); } Other {nslog (@ "% @ is dead and gone"), Myhuman.humanName); } [Pool drain]; Return 0; } Here is the code that complains about Xcode:  
  - (boolean) man is alive: (id) manpower {if (humanobj .living == Yes) {return yes; } no return; }   

It looks legal and everything, but encode complains that there is no such property in this object and no such object exists.

Help?

Objects with type id with an instance method on any object Can not be safely solved, so they are denied by language. In addition, if you can add the attribute to id , then we have spoiled a language.

All you need to do is be more specific:

  - (BOOL) humanIsAlive: (MyHuman *) humanobj {// ...}   

If you have to handle two unequal types of objects, then be a little more secure about it and use -isKindOfClass: , then place the object in the place where its properties are used. It is advisable to do

c++ - Priority queue in reverse order -


Indicates if I want to reverse my priority queues, I should use the following code:

  #include & lt; Iostream & gt; #include & lt; Queue & gt; using namespace std; Class mycomparison {reverse baul; Public: mycomparison (const bool & revparam = false) {reverse = reptum;} Bull Operator () (Constant and Lives, Constant and RA) Const {if (Returning) returns (LHS> RA); And return (LHS & lt; rhs); }}; Int main () {int myints [] = {10,60,50,20}; Priority_youm and lieutenant; Int, vector & lt; Int & gt;, mycomparison (true) & gt; First; Return 0; }   

This disturbs me:

  • I have to specify the storage class in my constructor.
  • I have created a class whose priority is to pass the only purpose in the queue.

    Is there a more elegant or less verbose way of reverse-sorting of the priority queue? You can not specify storage containers, but you can avoid writing your own draft:

      Privacy_Jews & lt; Int, vector & lt; Int & gt; std :: big & lt; Int & gt; & Gt; First;    

node.js - Grunt.js output and write contents of folder to file? -


लक्ष्य:

गतिशील रूप से / static / js / ** / *। Js < / Code> और / static / css / ** / * .css फ़ाइलें भी

विधि:

मैं क्लाइंट साइड टेम्पलेटिंग आंशिक उपयोग कर रहा हूं, इसलिए इस उदाहरण में, मैं सभी में फाइलपथों को लिखना चाहूंगा:

/ static / js / ** / *। Js भी /templates/head.js.dust
/ static / css / ** / * .css बहुत /templates/head.css.dust

फ़ाइल पथ पाठ्यक्रम के लिए पर्याप्त नहीं हैं। मुझे आउटपुट को पूर्वप्रक्रिया करने का एक तरीका चाहिए ताकि प्रत्येक "फाइल" उचित टैग द्वारा लिपटे जाएं जैसे:

  & lt;! - /templates/head.js.dust - & gt; & Lt; script src = "/ static / js / assests / jquery.js" & gt; & lt; / स्क्रिप्ट & gt; & Lt; script src = "/ static / js / assests / jquery_ui.js" & gt; & lt; / स्क्रिप्ट & gt; & Lt; script src = "/ static / js / app.js" & gt; & lt; / स्क्रिप्ट & gt; ... & lt;! - /templates/head.css.dust - & gt; & Lt; link src = "/ static / css / assests / jquery_ui.css" / & gt; & Lt; link src = "/ static / css / app.css" / & gt; ...   

प्रश्न:

क्या वहां से कोई कठोर मॉड्यूल है जो पहले से ही ऐसा कुछ करता है?

बोनस अंक: मैं कैसे ऐसा कुछ भी शुरू कर सकता हूँ अगर ऐसा नहीं होता?

आप एक बहुत ही आसान तरीके से ऐसा कर सकते हैं:

  grunt.registerMultiTask (" assetAppend "," एक फ़ाइल में जेएस / सीएसएस संपत्ति जोड़ें ", फ़ंक्शन () {var पथ = Grunt.file.expand (this.data.paths), बाहर = this.data.output, सामग्री = ""; paths.for प्रत्येक (फ़ंक्शन (पथ) {if (/। Js $ / i.test (पथ) ) {Content + = '& lt; script src = "' + path + '" & gt; & lt; / script & gt;';} और यदि (/ \ .css $ / i.test (पथ)) {सामग्री + = '& lt ; लिंक rel = "स्टाइलशीट" प्रकार = "टेक्स्ट / सीएसएस" href = '+ + पथ +' / & gt; ';}}); grunt.file.write (बाहर, सामग्री);}); Grunt.initConfig ({assetAppend: {js: {paths: ["static / js / ** / *। Js"], आउटपुट: "head.js.dust"}, सीएसएस: {पथ: ["स्थैतिक / सीएसएस / ** / *। Css "], आउटपुट:" head.css.dust "}}});   

यह उदाहरण अब मेरे प्लगइन का हिस्सा है

objective c - Xcode whitespace screwed up on git rebase -


After a GIT rebace, the code I have added / modified is indented to the left of four spaces or more Is the code block related to this incredibly disturbing and time consuming to decide, with the purpose of not mentioning it makes it unreadable for the purpose (if I was coding in Python ...?)

Xcode (or whatever, git?) Adds to the tab instead of the space, and mer Akskod is set to tab create spaces.

Why does not anyone see why this happens in my work? I made a trustworthy wrong, but he did not help any help?

This may be a white location setting. See options for core.whitespace on this. If you have this set as well as apply.whitespace , then git will do some work in your white location, probably during a rebase.

Apply git config core.whitespace and git config. Find Whitespace and modify them in your ~ / .gitconfig file or with something like:

  GIT Config - Global apply. Wisspace Space Orders    

ios - difference between Hybrid and Hardware decoding -


Hybrid and hardware decoding settings exist for the iOS player (such as an app player or opener). Both are designed for the H.264 codec (usually to play HD files with H.264 codecs). I do not understand the difference between them.

Can anyone explain me?

When a decoder is labeled as a hardware decoder, So that means decoding is done entirely by the hardware block in the forum. When such a Fixed Function Hardware Block exists, one of the main factors is believed that the functionality will be limited, only those features supported by the hardware decoder will be supported and In case, a new feature is required, you have to go for the same redesign and re-spin .

The main advantage of the hardware decoder is that it is usually power efficient because the hardware is specially designed to implement functionality. Additionally, overall system performance is also optimized to match the output formats of the hardware decoder block to GPU

When a decoder is set to software Is labeled as decoder, it is a pure software based implementation of the codec running on the CPU. This implementation functionality helps in increasing the functionality of the built-in codec because it is just a replacement for the older version of the SW version.

The main disadvantage of a software decoder is that this power will be intensified, with large memory access for large video resolutions, the need for power for software decoder is greatly increased and the battery is rapidly drained It is certainly not a good option for long offers of big offers and playback.

Hybrid decoders is another class that integrates a software module that acts as a pre-processor usually with a built-in hardware engine For example, if there is an underlying high performance DSP or SIMD engine, then the serial part of decoding such as pre-processor CIVLD and other header / bit parsing can operate, Intra Prediction , Motion compensation will be a more complex mathematical part of the operation by an underlying hardware segment

some hybrid decoders Regarded as the hardware decoders Expertise, but they renewed Hardware Decoders are available today worldwide.

hadoop - What exactly does the double colon mean in Pig? -


When I use DESCRIBE , I see too many double colons in pig production Is not, and it is not clearly what they mean.

For example, after grouping and leveling, I see something like this:

Key :: Supervisor: chararray, key :: endpoint: chararray. ..

At some point I had grouped the supervisor and end point, changed the group's tuple to 'key', and then was refailed. So, what exactly does the double colon mean, and the first relation (key? Observer?)

In your question, :: is a disputed operator and it is used to identify field names after JOIN, Cogprop, Cross or Flat operator. You can find an example of using different operators.

In your case, you have two field observers and end points and both are identified with key aliases, which means both supervisors and end points are referenced in the same aliases, the other "inspector and end point"

I think that you have used something below: some_statement_with_observerID_and_endpoint otherkey = some_statement_with_observerID_and_endpoint

give you on that basis Something similar to the one found here is:

  key :: Supervisor ID: Charray, Key :: End point: Charray, ...   

The above sentence means the supervisor and you can see the end point is not the surname of the other part of the main alias

Unit testing ServiceStack REST webservices -


I tried to test some of the unit's attempts to test the rest of the service, but to no avail.

  1. The indexed post, by creating DirectServiceClient, but the "no method not implemented" exception has been raised.

  2. Turned the web service directly and called any () method, it worked, but it kills DB. I started the connection in the setup as below but how I duplicate the connection object and I do not know the in-memory client object is set.

    _dbConnection = New OrmLiteConnectionFactory (TestConfig.ConnectionString, SqlServerDialect.Provider). Open DB Connection ();

    Customer Service

      Public Class Customer Service: Service {Private Readonly IDbConnection _dbConnection; Public Customer Service (IDbConnection dbConnection) {_dbConnection = dbConnection; } Public Items Any (Customer Request Request) {If (request.id == Faucet) {New Logic Expression ("ID Required"); } Var customer = _dbConnection.QueryDapper & lt; Customers & gt; ("GetCustomer", new {@ id = request.id}). ToList (); Return customer; } [Route ("/ Customer / {ID}")] Public Category Customer: Request:   

    Request

      [Route ("/ Customer") ] IReturn & LT; Customers & gt; {Public string id {get; Set; }}    

    This is the only test that I can write for this method I am

    Ozzehko's answer will give the examination of code path that throws an exception. If you want to test the code path that runs before the exception, you will need to copy / stub the _dbConnection .QueryDapper call

    Expand in detail in Ozkazio's answer "Any_CalledWithAnId_ReturnsCustomer ()" ' By adding and all the 'celebrations' I have modified some of the code in the code provided by you. Instead of joking / changing IDbConnection for the new test, I have just created an InMemoryTestDatabase for testing. Don "t use it against its own database because it wipes out the 'Client' table for testing. [TestFixture] Public Class CustomerServiceTest { Public IDbConnectionFactoryInMemoryTestDatabase; [Set Up] Public Zero Setup (InMemoryTestDatabase = New OrmLiteConnectionFactory ("c: \\ testData.db", SqliteDialect.Provider);} [Test] Public Zero Any_CalledWithoutId_ExpectThrowArgumentException () {var db = MockRepository.GenerateStub & Lt; IDbConnection & gt; (); Var Requests = New Customer Service (); var Service = New Customer Service (DB); Responsibility Q & A; Logic Option & gt; ((= = Service) Any (Request));} [Test] Public Zero Any_CalledWithAnId_ReturnsCustomer () // Make your data request long ; (Var con = InMemoryTestDatabase.OpenDbConnection ()) {To make the customer.CreateTable & lt; Customer & gt; (true); // Force table and data to create the drop drop customer & lt; Customer & gt; (New Customer {FirstName = "Johnny", LastName = "Test"}); RequestId = con.GetLastInsertId ();} // Act var Rick Uest = new customer credits {id = (int) requestId}; Var service = new customer service (InMemoryTestDatabase.OpenDbConnection ()); Var result = (customer) service. Any (request); // Assign fears. Unsure (requestId, result.Id); Confirm. Erequal ("Johnny", results first name); }} [Route ("/ Customer / {ID}")) Public Category Customer Vacancy: iMartan & lt; Customers & gt; {Get public long id { Set; }} Public class customer {{AutoIncrement} public long id {get; Set; } Public string first name {receives; Set; } Public String LastName {get; Set; }} Public Sector Customer Service: ServiceStack.ServiceInterface.Service {Private Readonly IDbConnection _dbConnection; Public Customer Service (IDbConnection dbConnection) {_dbConnection = dbConnection; } Public object no (customer request) {if (request.id == null) {new argument expression ("id is required"); } Var customer = _dbConnection.QueryDapper & lt; Customers & gt; ("Choose ID from ID * @id", new {id = request.id}). ToList (); Return customer FirstOver Default (); }}

c++ - why there is a integer overflow in this multiplication? -


मुझे इस कोड स्निपेट पर हैरान हूं:

  #include & lt; climits & gt; # शामिल करें & lt; iostream & gt; Int main (शून्य) {नामस्थान std; Cout & lt; & lt; "लम्बे अधिकतम" & lt; & lt; LONG_MAX & lt; & lt; endl; लंबे x = 2 * 1024 * 1024 * 1024; Cout & lt; & lt; "2 * 1024 * 1024 * 1024 =" & lt; & lt; एक्स एंड एलटी; & lt; endl; वापसी 0; }   

मैं 2147483648 की अपेक्षा कर रहा था, इसके बजाय मैं मिल रहा हूं अहस्ताक्षरित का उपयोग करने में मदद नहीं लगता है क्या देता है?

  लंबी अधिकतम 9223372036854775807 2 * 1024 * 1024 * -20 = 2147483648    

कुछ एल एस * जोड़ें लंबे x = 2L * 1024L * 1024L * 1024L;

(तकनीकी रूप से, जब तक एक शब्द का शाब्दिक प्रकार लंबा होता है अन्य को पदोन्नत किया जाएगा लंबा )

अतिप्रवाह होता है क्योंकि 2 , आदि प्रकार डिफ़ॉल्ट रूप से int होता है और अतिप्रवाह होता है असाइनमेंट से पहले

देखें जो विभिन्न लीटरल्स को बताते हैं।

php - Passing data directly to client -


I was thinking that without collecting the image data, one could pass data directly to the customer (a particular one image) Was the method used on server disk and / or memory using the PHP Zend Framework?

I am currently doing this:

  $ data = "raw image data"; $ Type = "image / jpeg"; $ Response = $ this-> getResponse (); $ Response- & gt; Set header ('content-type', $ type, true); $ Response- & gt; Set header ('content-length', strollon ($ data), true); $ Response- & gt; Set header ('content-transfer-encoding', 'binary', true); $ Response- & gt; Set header ('cache-control', 'max-age = 3600, required-modified', true); $ Response & gt; SetBody ($ data); $ Response & gt; SendResponse (); Go out;    

You are missing out on all $ response-> SendResponse () ; Exiting before and you are good.

binary - How to implement a logical shift (to the left) by 8 bits? -


I am trying to determine how the previous 8 bits of a 16-bit (two-byte) word (i.e. byte ) Using the LC-3 instruction set to move left.

For example,

  0000 0000 1111 1111 - & gt; 1111 1111 0000 0000  

Now you understand that you are talking about LC-3, I found and referenced this presentation.

You have to implement one. There are many ways available to do this in particular.

If you understand, you will be able to do it in a straightforward manner.

Pass PHP variable to Javascript at a specific point -


I am passing a PHP variable in JavaScript, but only at a specific point in the code As PHP code continues, variables require me to change I can easily run just JavaScript and run PHP variables when the page is loading, but it does not pass the information that I want. I want Javascript to capture the PHP variable at that time, and then Ignore the subsequent changes.

The actual program is working with several thousand lines of code, so I created a simple page. Around the wrong with this issue, the code below shows what I am trying to do .

  & lt ;? Php $ php_var = 'something'; If (true) {$ php_var = 'new'; Echo & lt; Script type = "text / javascript" & gt; Js_var = "& lt ;? php echo $ php_var ;? & gt;"; Warning (js_var); & Lt; / Script & gt; '; } $ Php_var = 'Later changes'; ? & Gt; & Lt; Script type = "text / javascript" & gt; Var js_var; & Lt; / Script & gt;   

This does not work, however. Js_var is set when inline scripts are run, but it is set to only one string which is Instead of actually evaluating it, instead.

PHP runs first, and whatever JS is sent to the browser. I think you want it:

  echo & lt; Script type = "text / javascript" & gt; Js_var = '.json_encode ($ php_var).'; Warning (js_var); & Lt; / Script & gt; ';    

android - How do I change my package name after already obtaining a Google Maps API key? -


I was trying to upload my APK on the market for beta testing and I realized that my package name was com Not started with .example. My app is ready for beta, everything is in place but my package name is not allowed. I tried changing my package name in Android tool but my problem is with Google Maps because My app is already ready for com Health has signed up. Example I can run my app but Google Maps fails to load.

How do I change my package name after signing up with a Google Maps API key?

Just change the package name in Google API console Remember, the name of the project should be the same.

Android;Body of ProgressDialog? -


I saw the layout of this source in the AlertDialog res \ layout Folder of Android SDK in the form:

  & lt; FrameLayout xmlns: android = "http://schemas.android.com/apk/res/android" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" & gt; & Lt; LinearLayout android: id = "@ + id / body" android: orientation = "horizontal" android: Layout_width = "Match_parent" Android: Layout_height = "Match_parent" Android: baselineAligned = "false" Android: paddingLeft = "8dip" Android: PaddingTop = "10dip" Android: paddingRight = "8dip" Android: paddingBottom = "10dip" & gt; & Lt; ProgressBar android: id = "@ android: id / progress" style = "@ android: style / WidgetkProgressBar" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" Android: max = "10000" Android: Layout_marginRight = "12dip" /> & Lt; TextView android: id = "@ + id / message" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" Android: layout_gravity = "center_vertical" / & gt; & Lt; / LinearLayout & gt; & Lt; / FrameLayout & gt;   

I tried it ID that TextView to the "message" of:

  TextView tvMessage = (TextView) dialog.findViewById (android .R. id.message);   

This works fine. Then I think LinearLayout that this id is "body" tried this way:

  LinearLayout body = (LinearLayout) dialog.findViewById (android.R.id.body);   

But eclipse shows this error: body can not be solved or there is no field

This is the snippet code:

  progress dialog = new progress DIOO (WriteOperinactivity.This); Dialog.setMessage ("some text"); Dialog.show (); TextView tvMessage = (TextView) dialog.findViewById (android.R.id.message); LinearLayout body = (LinearLayout) dialog.findViewById (android.R.id.body);   

Why is this error and how can I access the "body"?

Actually, you can not access all of the resource platform res Are there.

Example I @ + id / message code> global_actions_item.xml, usb_storage_activity.xml, alert_dialog_holo.xml, js_prompt.xml, progress_dialog_holo.xml, progress_dialog.xml, alert_dialog I'm able to find .xml (for API 17), and therefore, there is no warranty that you get the id defined in the progress_dialog.xml (It can be defined in another file and only because of that name you can find it in the progress dialog).

Actually, public resources are defined, however, it looks very old, so some resources can be remembered. Check these questions about lists of all accessible resources: and

Is there something similar to array[1:] in java? -


Working with an array of strings and I want to call a method with a parameter, in which parameter 1 index End from In Python, this looks like something like array [1:], and I'm searching for something similar in Java, but nothing, thanks!

No you have to pass the initial index and (possibly) end index, it will look like this:

  public static zero doThing (int [] array, int start) {// something to do here [start] doThing (array, start + 1); }    

How to stop python pandas from adding "00:00:00" to every date? -


समय कोड डेटा को csv फाइल में pandas.Series.to_csv < कोड> जोड़ता है 00:00:00 को हर तिथि इंडेक्स पर जोड़ता है जो कि सीएसवी फाइल को किसी अन्य अनुप्रयोग में खोला जाता है जब परेशान होता है।

  दिनांक, मूल्य 2000-06-01 00: 00: 00,90.3 2000-06-02 00: 00: 00 9 2.69 2000-06-05 00: 00: 00 9 6.1   

क्या कोई साफ़ / अजगर तरीका है दिनांक के मूल्यों को लिखना जैसे कि अतिरिक्त 00:00:00 ?

और अधिक सामान्यतः यह pandas के साथ संभव है जो एक सूचकांक स्तंभ है समय-टिकट के विपरीत तिथि

संपादित करें: उन लोगों के लिए जो इस प्रश्न का दौरा कर सकते हैं, यह मैं जिस समाधान के साथ आया हूं:

  Io.StringIO के साथ: दक्षिण के रूप में: डेटा.to_csv (दक्षिण, शीर्ष = सच, अनुक्रमणिका = सच) खुले (fname, 'w') के रूप में fout: fout.write (sout.getvalue ()। Replace ('00 : 00: 00 ',' '))    

लिखने से पहले अपना सीरीज़ / डेटाफ्रेम मैप करेंसीएसवी फ़ाइल में:

  में [8]: पीडी के रूप में आयात पंडों में [9]: आयात दिनांक समय में [10]: s = pd.Series ([datetime.datetime.utcnow () ]) में [11]: s.map (लैम्ब्डा x: x.date () अगर ifinstance (x, datetime.datetime) दूसरे x) .to_csv ('test.csv')   

Test.csv:

  0,2013-03-27    

eclipse - NoClassDefFoundError on Google App Engine -


I am developing a project using both GWT and GAE on Eclipse Juno.

My original project works fine on its package and classes on the same project and when it is uploaded to Google App Engine on development mode and on the Internet.

Then I created another project (on the same workspace) classes that were normal so they could be used on other projects. I have not created a jar file, do I have to? I believe that I can keep my generic classes on another project without putting them on a jar file.

After some time, I was able to create the right XXX.gwt.xml file on both projects and the main project properties (project> gt;> Properties for viewing the visible sections for the new project main project On the "Projects" tab of the "Projects" tab, the GWT compiler found those moved classes, translated them into JavaScript code and executing the main project on client side. I was able.

My problem is on the server side. There is no problem that I try to run the server. It can not get the classes gone and when it is trying to execute any of them, then this development "Noklasfferer error" comes with error while running on mode (I have not tried uploading to Google App Engine on the internet yet). If I comment on all the contexts of those sections then the error does not appear on the server side, but of course I do not have the functionality.

Gaston Syron

Yes, you have to make a jar of another project, and It will be inserted into the web-INF / Lib folder.

If you can use Maven or Ant, then maybe you can apply an appenuary to compile another project in a jar and use it as a dependency for the app engine project. .

im writing a plugin for a python app, find i can't load any external library -


im writing a plugin for a python app, I can not load any external library ... This python app has its own little library set and other libraries do not find Python 26 folder. So I found that it is difficult to import any external libraries (such as Python-Twitter) in my plugin script. The way, I did not get permission to modify the python app, so I need to add some code to those plugin scripts that load those external libraries ... and more fun, most of the libraries call other libraries I have found a way to load a library but still this error should be added to the other call lubs ... PYTHONPATH = 'C: / Python26 / Lib / site-packages /' in front of my script Of the work, actually does not work ....

You place the places in the form of Python paths And add it to your plugin before the main code

  import sys sys Path.append ('your path')   

or < / P>

  sys.path.insert (0, "your path")   



javascript - How to get the inside json from json object -


मान लें कि मेरे पास यह json है

  {"widget": {"debug": " "", "विंडो": {"शीर्षक": "नमूना कॉन्फ़ाबुलेटर विजेट", "नाम": "मुख्य_विंडो", "चौड़ाई": 500, "ऊंचाई": 500}, "छवि": {"src": "चित्र "" "" "", "नाम": "सूर्य 1", "हेफ़सेट": 250, "vOffset": 250, "संरेखण": "केंद्र"}, "पाठ": {"डेटा": "यहां क्लिक करें", " आकार ": 36," शैली ":" बोल्ड "," नाम ":" पाठ 1 "," हेफ़सेट ": 250," वीओएफ़सेट ": 100," संरेखण ":" केंद्र "," ऑन-मेन्यूप ":" sun1.opacity = (सूर्य 1.पॉसिटी / 100) * 90; " }}   

मेरे पास इन ऑब्जेक्ट्स की सूची है और इस तरह की वैरिएबल में डाल रहा है

var myobjects = data < पी> जिसमें उपरोक्त वस्तुओं की सूची शामिल है

अब जो ठीक काम कर रही है लेकिन मुझे एक समस्या है वस्तुओं की सूची सीधे प्राप्त करने के बजाय, अब मेरे पास एक मूल ऑब्जेक्ट है जिसमें वे ऑब्जेक्ट शामिल हैं

  "id": "21" "myobject": {{"widget": {"debug "" "", "विंडो": {"शीर्षक": "नमूना कॉन्फ़ाबुलेटर विजेट", "नाम": "मुख्य_विंडो", "चौड़ाई": 500, "ऊंचाई": 500}, "छवि": {"src" : "" "", "नाम": "सूर्य 1", "हेफ़सेट": 250, "वी ऑफ़सेट": 250, "संरेखण": "केंद्र"}, "पाठ": {"डेटा": "यहां क्लिक करें "," आकार ": 36," शैली ":" बोल्ड "," नाम ":" टेक्स्ट 1 "," ओफ़सेट ": 250," वी ऑफ़सेट ": 100," संरेखण ":" केंद्र "," ऑन-होमपॉइस ":" sun1 .opacity = (सूर्य 1। ओपनिटी / 100) * 90; " }}}}   

बालोबैजेस की सूची पाने के बजाय, मुझे डेटा में अभिभावक ऑब्जेक्ट की सूची है I

var childobjects = data.childobjects

ऐसा कुछ करना चाहते हैं जैसे

क्योंकि मैं कोडित टेम्पलेट्स का आह्वान करता हूं जो केवल वोक अगर मुझे वस्तुओं की सीधी सूची है

क्या आप < ऑब्जेक्ट्स की सरणी समझाएं?

  / मान लीजिए कि डेटा इस प्रकार है: var डेटा = [{id: 1, myobject: {widgets: '', जो भी हो: ' '}}, {Id: 5, myobject: {widgets:' ', whatever:' '}}, {id: 23, myobject: {widgets:' ', whatever:' '}}]   

फिर यह कोड:

  var myobjects = []; (डेटा में कुंजी) {myobjects.push (डेटा [कुंजी]। Myobject); }   

myobjects को बराबर:

  छोड़ दें [[विजेट: '', जो भी हो: ''}, {विजेट : '', जो कुछ भी: ''}, {विगेट्स: '', जो भी हो: ''}]    

email - PermError SPF Permanent Error: Too many DNS lookup -


I have configured the SPF and TXT records when I check the SPF record syntax, it says PermError SPF permanent error:

  v = spf1 includes: _spf.google.com contains: netcore.co.in ~ all   

and also in my email spam Have landed.

1) I'm on shared hosting, I have not configured IP and DKIM. Actually, I do not send emails for triggering triggers. Since I'm on shared hosting, there is a possibility of another on shared hosting by sending incoming emails to my email to come to SAP.

2) I am sending netcore.co.in mail to and google.com to send mail from Gmail and I properly record MX Also I have mentioned Google MX record but do not record netcore.net MX. I am using sendgrid's free SMTP server to send email from my Java web app. Which I have not been told in the SPF record. SPF produces record of spam spam.

You should keep an eye on this question. I answered a few weeks ago:

You receive a DNS lookup for only 10 SPF (part of the protocol). There are two lookups for automatically getting your TXT record and actual SPF records. Without doing actual math (I will leave it to you as a practice), you are roaming in the neighborhood of 13-14 watching you need to strengthen your SPF record in one or drop one of those services (For example, SendGrid allows you to do both transactional and mass mailings in a set of IPs, so that you completely delete Netcore or Gmail).

For your spam issue, it should not be with you and they will be able to assist you in troubleshooting and solving the problem.

java - GWT client debugging with Eclipse -


I have a GWT app, which I have to debug both client Java class (GWT) and server business classes. I can successfully debug server side classes where the debug point hits when there is any service request process.

But the problem is in the client Java class debug points are not hit. What is the reason for this? Do I need a forward step or device to debug GWT Java classes?

I am using Eclipse Indigo and glassfish.

Launch your host page

If you directly from your ID code, host ( appName.html) ) then strong> (eclipse):

The browser must have a URL

  http: // Localhost: 8080 / index.html?gwt.codesvr= 127.0.0.1: 9997 ------- ^ --------- | appname.html -------- ^ ---- -----   

1 <<< P>

The third part debug query foot

If you are sending the page from servlet:

  request.getRequestDispatcher ("/ appName.html?gwt.codesvr = Forward (request, response);   

and check your debug cofiguration logic tab.

  -remoteUI "$ {Gwt_remote_ui_server_port}: $ {unique_id} "-startupUrl projectname.html -logLevel INFO - CodeServerPort 9997 -port 8888 -where e: \ workspace \ projectname \ war com.test.projectname   

See link for

javascript - Node.js/Express: Prevent AJAX HTML snippet from being loaded directly from URL -


I node a blog I am with JS, Express and Mongodybi.

I have a button to load more posts on the home page. It works fine and I complete it with the following code:

jQuery

  $ ("# load-more-posts"). (Function () {$ .ajax ({url: '/ load / posts /', type: 'get', data type: 'html', success: function (data) {$ ("# primary").); }, Data: {"passLastDate": last date}}); Return return;});   

App here app.js

  ("/ Load / post", routes.load posts);   

And here's the scene:

  loadPosts: function (Rick, Ridge) {var LastDate; End date = req.query.passLastDate; ("Publish": {$ lt: lastDate}}) Sort ('- publish_date'). Limit (1) .execFind (function (mistake, post) {if (posts === []) {console.log ("thats"); return res.render ("thats-it", {layout: wrong}) ;} Else {lastDate = posts.slice (-1) [0] .publish_date; return res.render ("more-post", {layout: false, post: post, end date: last date}}}}}) ; } Like I said, all this works great, however, if I copy the GET URL from the console and paste it in the browser, then I will get back the HTML snippets returned. I think it is doing such a thing, but I do not want to return it. I do not think this is a safety hazard, it just seems a bit constrained.  

Is there a way to block direct requests on this scene?

Bonus

Here's something else that's strange, and it makes a two-part question when I If check the empty post array in the statement, if the node ignores it, the console output shows post = [] , still it leaves it on it and then lastDate = Posts.slice (-1) is inserted on [0]. Publish_date; I know that JS behaves strangely with empty values ​​(empty, undefined, empty string, etc.), but I have tried different people with the same result. It seems that it is completely Ignoring it is I taking mad tablets?

Is there a way to block direct requests on this scene? P>

  loadPosts: function (rick, race) {if (rake ideas ['x-request-with'] === 'XMLHttpRequest') {// AJAX request} else {// do not request an AJX}}   

It should not be used as a security measure (because it is not), but to see if the request Whether AJAX has been used or not

For your second problem, [] === [] is actually wrong (such as [] == [] ), so it There is not a good way to see if no array is empty or not. I suggest you use it:

  if (! Posts = posts.length === 0) {// blank}    

node.js - SALT and HASH using pbkdf2 -


I am using the following methods to create snack and hashead passwords from cryptobb in nodejs: < Cryptto.pbkdf2 crypto.randomBytes crypto.pbkdf2 (password, salt, iterative, keylen, callback)

for randombeats call (create SALT) what size Should i use I've heard 128-bit salt, maybe 256-bit It seems that this function uses a size in bytes, so can I consider 32 (256 bits) in size enough?

For PBKDF2 calls, what is a good number of iterations and what is the key length (keylen) for the key?

In addition to that, I've seen examples of salt, length, iterative and derviedkey storage in the same column for storage, I am using an example which is 4 to :: Separates from, i.e.:

  salt :: derivedKey :: keyLength :: iterations   

By doing this, I get 4 values I can separate it on :: , so I can generate a derived key based on the password I provided, to see that Or it matches. Is this the right way to store? Or should a combination of these values ​​be somewhat more "confusing"?

1 random bytes size :

salt Less than should be the same as your hash function, so for sha256 you should use at least 32 bytes. Node JS crypto has pbkdf2 to use SHA1 , therefore 20 bytes should be minimum. However, at least you should use 64bit (8 bytes) , as stated in # 3 (source :).

Number of 2 PBKDF 2 iterations :

Look for a great discussion. I took that from without the performance 10.000 range is enough, but this hardware / performance is dependent.

3. Length of PBKDF2 :

See about the key length. The parameter is again using the hashing function, SHA-1 in your case, so 20 bytes is the correct value. Since the salt of at least 64bit is recommended, it is trash to generate a small key from your input, so use at least 8 bytes . Do not use the output length of more than 20, because it does not provide any additional protection, but the Eugble Count Number for each of 20's.

4. How to store variables :

All links given above are specifically discussed (especially), salt should be saved with password (but never used again Can be done), usually by adding it to the resulting string (salt: hash), or in any other database column.

As far as the other variables are concerned, their security is not important to break security (as stated, so that you can safely pametrate it anywhere. " Your way of doing it is OK, but you are saving additional information . To save only "algorithm: iterations: salt: hash" , in your case, "salt :: levitored:: iterated" It's important.

web services - how to get the 1 million-th click of a website -


I have often come across this question from various sources, but never got a good idea of ​​technologies to get it is. Can any light leave? The question is that you have a website that has more access to users per day. Your website has been deployed in a distributed way, there are many webservers and there are load balancers to respond to incoming requests from many locations. How do you gain access to 1000000 users, and "Congratulations, you are 1000000 visitors!" Say a special page by saying Suppose you had a distributed backend.

You have to turn off performance or accuracy. The simplest way to do this would be to have a memcached example keep track of your visitor calculations, or with any other datastore atomic increment operation. Since there is only one source of truth, therefore only 1 visitor will get the message. This will delay your page on the goaltipripte at the landing store at the minimum.

If you can not delay, then you have to close the accuracy. A distributed data store will not be able to increase any field atom any faster than at any level. Each web server can read and write local nodes, but 1 million users can access before the transaction matches, but there may also be one node on the second datacenter. In that case 2 or more people can get 1 million user messages.

It is possible to do this after the fact. After all, the data store will increase the increment, and your app can decide on a strict order. However, if you have already decided that a single nuclear request takes too long, then this argument will be too late to present your page.

Calling Java Function from XSLT gives "Could not compile stylesheet" -


I have gone to all positions of similar issues, but I can not solve my problem as shown below as XSLT Gone:

XSLT:

  & lt ;? XML version = "1.0" encoding = "ISO-885 9-1"? & Gt; & Lt; Xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" xmlns: proxy = "java: com.hp.gpp.pp.util.UrlUtils" extension- Element-prefix = "proxy" & gt; & Lt; Xsl: output method = "xml" version = "1.0" indent = "yes" /> & Lt; Xsl: Ultimate name = "proxy" /> & Lt; Xsl: variable name = "baseurl" = "/ html / head / base / @ href" /> & Lt ;! - Output to copy input - & gt; & Lt; Xsl: template match = '* | @ * '& Gt; & Lt; XSL: Copy & gt; & Lt; Xsl: apply-select template = 'node () | @ * '/ & Gt; & Lt; / XSL: Copy & gt; & Lt; / XSL: Templates & gt; & Lt; Xsl: template match = "* [@ href]" & gt; & Lt; XSL: Copy & gt; & Lt; Xsl: attribute name = "href" & gt; & Lt; Xsl: select value = "proxy: rewrite ($ proxy, $ absolute, @ href)" /> & Lt; / Xsl: attribute & gt; & Lt; Xsl: apply-select template = "node () | @ * [name (.)! = 'Href']" /> & Lt; / XSL: Copy & gt; & Lt; / XSL: Templates & gt; & Lt; Xsl: template match = "* [@ src]" & gt; & Lt; XSL: Copy & gt; & Lt; Xsl: attribute name = "src" & gt; & Lt; Xsl: Select Value = "Proxy: Reconstruction ($ proxy, dollar basal, @ SRC)" /> & Lt; / Xsl: attribute & gt; & Lt; Xsl: apply-select template = "node () | @ * [name (.)! = 'Src']" /> & lt; / XSL: Copy & gt; & Lt; / XSL: Templates & gt; & Lt ;! - rewrite & lt; A href & gt; - & gt; & Lt; Xsl: template match = "base" & gt; & Lt; / XSL: Templates & gt; & Lt; / XSL: stylesheet & gt;   

And a Java code is as follows:

  XSLTemplateFactory templateFactory = New DefaultTemplateFactory (); Templates templates = TemplateFinders .getTemplatesFromURL (XSS_FILE_NAME); Source xmlStrim = new streamsource (reader); Results oStream = new stream result (res.getWriter ()); Transformer Transformer = Templates. NEU Transformers (); Transformer. Sitemapator ("Proxy", New Urutils (Reich, Ridge)); Transformer. TransSForm (XMLSTM, Ostream); In any case, the code works locally but gives it when deploying:  
  error: 'non-static java function The first argument for 'rewrite' is not a valid object reference. 'Incorrect error:' stylesheet can not be compiled 'com.hp.gpp.pp.exception.ProxyPortletException: error.transformer: stylesheet could not be compiled   

this problem Is not able to find here. Can anyone help me in this?

Thanks & amp; Richin

You must remove the transformer.setParameter call from your code. And and LT related to your XSLT; Xsl: param name = "proxy" /> directions.

Then put the prefix of names in the Java class, like

     

Then you can write

  & lt; Xsl: attribute name = "href" & gt; & Lt; Xsl: Select value = "Proxy: rewritewritable ($ basural, @ rff)" /> & Lt; / XSL: Specialty & gt;   

I think that rewriteRelative takes only two parameters: the base URL and a relative URL? I'm not sure the previous parameter was for $ proxy , but I think it is not included in it.

r - randomize or permuting values in a data.frame -


I have a data Frame that looks like this: (My real dataframe is big):

  df < - data.fr (A = C ("A", "B", "C", "D", "E", "F", "G" "H", "I"), B = C (" 1 "," 1 "," 1 "," 2 "," 2 "," 2 "," 3 "," 3 "," 3 ") C = C (0.1,0.2,0.4,0.1,0.5,0.7 , 0.1.0.2,0.5))> & gt; DF ABC 1A1 0.1 2 B1 0.2 3 C 1 0.4 4 D2 0.1 5 E 2 0.5 6 F2 0.7 7 G3 0.1 8 H3 0.2 9 Ii 0.5   

I Want to add several n-columns (like permutations ), where the column D will be a random value from D df $ C but this value should be selected from those rows < With the best price of Code> df $ B , an example of the desired product would be:

  df < - data.frame (A = C ("A", "B", "B", "C", "D", "E", "F", "G", "H", "I") B = C ("1", "1", "1", "2", "2", "2", "3", "3", "3"), c = c (0.1.0.2.0.4, 0.1,0.5,0.7,0.1,0.2,0.5), D = C (0.20.2,0.1,0.5,0.7,0.1,0.5,0.5,0.2))> DF ABCD 1A1 0.1 0.2 2 B1 0.2 0.2 3 C1 0.4 0.1 4 D2 0.1 0.5 5 E2 0.5 0.7 6 F2 0.7 0.1 7 G3 0.1 0.5 8 H3 0.2 0.5 9 I5 0.5 0.2   

I have tried the package with plyr but my approach does not work properly:

  ddply (df, level (. (B)), conversion, D = sample (C))   

I also have thought of dividing dataframe based on df $ B and its Each data frame using lapply to add a later function But I have no indication that how to choose the df $ B level,

many thanks

plyr , ave

  transform (df, d = ave (c, b, fun = function (b) sample (b, replace = TRUE))    

amazon web services - HTTP Live Streaming via AWS cloudfront -


To know that any signature URL is capable of streaming HLS video via AWS CloudFrint.

My experience is so far, it is not possible. The AWS document is not clear. AWS Forum is silent.

I think the first file (.m3 U8) is able to get it, then it stops. Using the JW Player, who complains that he can not get the media file.

If the answer is yes, please tell me in the right direction.

Thank you.

Unsigned the scenario will most definitely work with the URL I Video streams with FFPAP have been divided into 3 and served with CF. It's all after all the HTTP is

If you want to restrict access to your HLS content, then you must include the signed URL in your playlist file . You will usually count them as the playlist is requested, based on the user's credentials, depending on what you want to certify. In this way, you need server-side implementation that prepares you for session-unique M3U8 to understand the sign-url scheme.

Depending on your needs, one more option would be to consider the DRM. JW player single / rotating key block decryption, which can arguably be a more complex solution. Then you will leave your customers in case of securely delivering the decryption key.

I hope that it tells your concerns to some extent, if not, feel free to leave a comment.

html5 - My javascript (for randomizing css3 animation delays) doesnt fire in IE 10 and Opera...Jsfiddle Included -


I have encountered this problem and I am trying to fix it by day. Everything I have done is making an JSFEL with an explanation of the whole issue and an example example code for you. (For Var = n), 0, r = t. Long; N & LT; R, N ++) {E = Mathrade (Math.Randem) * 7A3) + "MS"; T [n] .style. Animation Dele = A; T [n] .style.WebkitAnimationDelay = e}}, false)

What am I doing wrong? It does not seem to work in IE 10 or Opera.

EDIT: It seems that IE10 only removes the script when refreshing the page.

Printing variable values to console visual c++ windows store Modern UI app -


I'm just starting to learn C ++ / XAML Windows Store app development, but I can not find good for my life How to Print Variable Value in "Output" window in VS 2012

debug.proved () is not present for the Windows Store app and I have a way to print out a OutputDebugString () I can not use variable values ​​to print (without some heavy formatting).

An easy way to print an example line is:

Position of the mouse X: 12

For example, Where 12 is an integer that comes from MouseDelta . >

Thank you for your time,

Poncho

Here's a good alternative:, basically it allocates to the console for your Windows Store app, obviously this certification will fail but given that it may only be for debug purposes, it will be fine . I am copying the relevant code here:

  // Include Windows.h for WINBASEAPI and WINAPI: #include & lt; Windows.h & gt; // Announce your AllocConsole, because Windows.h leaves it: extern "C" WINBASEAPI int WINAPI AllocConsole (); Auto Main (Platform :: Array & LT; Platform :: String ^ & gt; ^) - & gt; Int {AllocConsole (); Std :: wcout & lt; & Lt; L "Hello there!" & Lt; & Lt; Std :: endl; Std :: getchar (); Return EXIT_SUCCESS; }   

However, if you want to see such output inside your app, then you want to use it, which applies the part of the .NET System.Console and secure it. As can be used within the Windows Store apps.

asp.net - How to Check RadioButtonList when Option Selected is Changed? -


मेरे पास एक .NET / ASP.NET आधारित प्रपत्र है जो एक रेडियोबूटोनलिस्ट का उपयोग करता है जिसमें डिफ़ॉल्ट रूप से कोई विकल्प नहीं चुना जाता है:

  & lt;% @ Control language = "C #" AutoEventWireup = "true" CodeFile = "Rb.ascx.cs" इनहेरिट्स = "आरबी"% & gt; & Lt; तालिका & gt; & lt; tr & gt; & lt; td align = "left" & gt; & Lt; एएसपी: रेडियोबटन लिस्ट आईडी = "रेडियोबटन लिस्ट" रनैट = "सर्वर" & gt; & Lt; / एएसपी: RadioButtonList & gt; & Lt; / td & gt; & lt; td valign = "top" & gt; & Lt; asp: RequiredFieldValidator आईडी = "रेडियोबटन लिस्टवालिडेटेटर" रनैट = "सर्वर" कंट्रोलटॉवालिडेट = "रेडियोबटन लिस्ट" त्रुटि संदेश: "कृपया एक विकल्प चुनें।" टेक्स्ट = "*" मान्यकरण समूह = "मान्य" & gt; & Lt; / एएसपी: RequiredFieldValidator & gt; & Lt; / टीडी & gt; & lt; / टीआर & gt; & Lt; / तालिका & gt;   

सूची में से किसी एक विकल्प के लिए, जैसे ही इसे चुना जाता है मैं एक चेतावनी संदेश बॉक्स उत्पन्न करना चाहता हूं (विवरण लेबल के कुछ प्रकार का उपयोग करने के बजाय) या सत्यापन त्रुटि संदेश)। जहां तक ​​मैं बता सकता हूं, कोई भी इवेंट हैंडलर नहीं है जैसे कि _SelectChanged मैं सोच रहा था कि इस तरह की एक ऐसी सुविधा को कैसे लागू किया जा सकता है (नीचे अर्द्ध- psuedocode है क्योंकि मुझे यकीन नहीं है कि मैं क्या चाहता हूं कि मैं क्या चाहता हूं) के लिए एक ईवेंट हैंडलर की प्रतीत होता है: <पूर्व> सार्वजनिक ओवरराइड शून्य रेडियो बटन बटन चयन (ऑब्जेक्ट प्रेषक, इवेंटएरग्स ई) {यदि (रेडियो बटन लिस्ट। चयनित IITem == "विकल्प 2") // जहां 'विकल्प 2' रेडियो बटन के आगे वास्तविक फ़ॉर्म पर प्रदर्शित होता है {संदेश बॉक्स । ("चेतावनी: इस विकल्प का चयन घातक न्यूरोटॉक्सिन जारी कर सकता है"); }}

सही तरीका मान संपत्ति की जांच कर रहा है सूची नियंत्रण में चयनित आइटम का आप SelectedValue प्रॉपर्टी का उपयोग कर सकते हैं, ऐसा कुछ करने का प्रयास करें:

  अगर (रेडियो बटन लिस्ट। चयन किया गया वैल्यू == "विकल्प 2") {Messagebox.Show ("चेतावनी: इसे चुनना विकल्प घातक न्यूरोटॉक्सिन रिलीज कर सकता है ")}   

आप SelectedItem.Text संपत्ति का उपयोग कर भी जांच सकते हैं।

  if (radio buttonList SelectedItem.Text == "Option 2") {Messagebox.Show ("चेतावनी: इस विकल्प का चयन घातक न्यूरोटॉक्सिन जारी कर सकता है")}   

यदि आप asp.net पर हैं, तो आप संदेश बॉक्स है। दिखाएँ, आपको जावास्क्रिप्ट चेतावनी का उपयोग करना चाहिए।

Using city names to put marker on the map instead of using Latng and Long in javascript mapping library? -


I am working on the mapping project, and I want to use the city name to place my markers on the map I am There are some JavaScript libraries that really make good maps like Raphaelz, and Javitormap. However, I have seen these libraries with latee and long values. Can I use the name of the city to identify the location on the map instead, and keep my marker?

You can change the name of a city into a latitude / geo coding:

java - Need Conceptual Help Rendering a Heat Map -


I have to make a heatmap for Android Google Maps. I have geographical locations and numbers that are negative and positive weights which I want to visually represent. Unlike the majority of Himachal, I want to interfere with these positive and negative weight destructive; That is, when the two points are closer to one another and one is positive and the other is negative, the overlap of them interferes in a destructive way, effectively does not present those areas which are completely canceled We do. I am planning to use Android Google Map's Tile Overlay / Tile Provider category, on which to build / render the tile based on a given location and zoom. (I have no problem with this part.)

How should I go about presenting these tiles? I am planning to use the graphics class of Java, but the best I can think of is running through every pixel, it calculates what color it will be based on the surrounding data points Should and should project that pixel though it is very inefficient, though, and I was looking for suggestions on a better approach.

EDIT: I have considered everything to use a tile overlay to use a non-Android Google map inside the web-view. What a ground overlay I'm considering now I have a large 2-dimensional array of "squares". Each class has a long, latitude, and total +/- load, when a new data point is added, instead of providing it in the same way, it will be added to the "class" which is that which is. The weight of this data point will be added to the class and then I will use GoogleMap to present the square on the map polygon object The ratio is clear from 1 point, 1: blue (cold point), and & lt; With the ratio of having 1 red (hot point), points are numbered for the properties, which is determined by the color. Edit: Clustering data in small regional groups

I'm trying < Blockquote>

is going through every pixel, it calculates what color it should be based on the surrounding data points, and that pixel should be interpreted.

Even if it is slow, it will work, there are not too many tiles on the screen, each does not have too many pixels in the tile And all this is done on the background thread.

All this is still done by translating it into bitmap in byte [] . Byte [] is a representation of PNG or JPG file, so it is not a simple pixel mapping from bitmap . The last operation takes some time and possibly more processing power than your entire algorithm may be required.

Edit (moved from comment):

In the edit you tell that clustering on LatLng I can not say that this is a better or a bad idea, but try something Is worthy.

jquery - Divide percentage amongst text inputs -


How do these people go,

What do you say is that dividing one percent apart What is the best way to use input using Jquery? To wit. & lt; Input type = "text" value = "" name = "inputon" /> & lt; Input type = "text" value = "" name = "input two" /> & Lt; Input type = "text" value = "" name = "inputThree" /> & Lt; Input type = "text" value = "" name = "inputfire" />

This idea is assumed to be on the key of each of these inputs - is reduced by 100% and then divided and set as the value of the other fields goes.

In the end, if input 25 should be shown in the remaining field as the input value:

   & Lt; Input type = "text" value = "25" name = "inputtree" /> & lt; Input type = "text" value = "25" name = "inputfire" />   

As always, any help is appreciated

< P> You can try this approach ..
  $ ('input'). ('Keyup', function () {var val = this.value, $ allInputs = $ ('Input'); if (Val> 100) {$ allInputs.val (100 / $ allInputs.length);} And {var length $ ('Input'). No (this) .val ((100-val) / ($ allInputs.length- 1));}});   

However, the need to add some error checks

meteorite - trouble with filepicker script loading in meteor -


There is not much luck to load the filepicker package in my meteor project yet

What did I do :

  $ cd ~ / myMeteorProject add $ mrt filepicker & gt; & Gt; & Gt; Smart Package $ $ smart smart.json & gt; & Gt; & Gt; ; {"Package": {"Router": {}, "File Picker": {}}} $ MRT & gt; & Gt; & Gt; Stand back, while the silence talks about it, it's okay to install smart packages, everything is ready, here comes the meteorite! [[[~ ~ / MyMeteorProject]]]]]]] => Inverted server is running: http: // localhost: 3000 /   

So at this point I feel as if I expected (I also doubled the contents of the filepicker package and in it All that I expected was the same URL for loading the source, as is found on the filepicker.io site.)

However, when I run the following (compiled from coffeescript) Try:

  if (Meteor.isClient) {Meteor.startup (function () {return filepicker.setKey ('A9FiXXdu5RB ^ GYujfDPwlz'); // My Vastu I do not have a key, do not worry}}}   

I get: unwanted reference references: file picker is not defined

So, it's kind of a bummer Any idea? I have tried to delete coffeescript and filepicker and add it again. Is there a load-order problem? I think if the file fails to load then there is a warning in filepicker-load.js, which I do not Seeing ...

your syntin Looks good and uses what's in my app - I am thinking that since the filepicor script loads the script by scribbling the element, then you have a timing problem (calling the set before the script loads)

It may prevent the user from setting the key unless something does not, such as

  filepicker.setKey ("key"); Filepicker.pickAndStore ({...}, function (error) {...});   

or set it with a timeout

  Meteor.setTimeout (function () {filepicker.setKey ("KEY");}, 1000) ; You can also use an interval to check if desired (more tolerant of long load time) - you can adjust it to leave after some time < / P> 
  var filepickerInterval = Meteor.setInterval (function () {if (filepicker) {Meteor.clearInterval (filepickerInterval); filepicker.setKey ("key");}}, 100);    

javascript - Strange issue with jQuery .hide() -


I am creating a site for a customer, but I am using one of jQuery's .hide () Weird bugs have encountered function

If you check it and click any one of the thumbnails, you will see that the image is aligned on the left. Now if you have any other browser tabs Open or switch, and then go back to the sample url, then the image is centered ...

Image Center The must, and while I have it not connected, worked fine;

  $ (".link-content-overlay"). Hide ();   

My script file ...

Anyone have any idea why this is happening and how can I fix this?

You have a problem with CSS (probably your slideshow generated by Javascript Lib). When the browser is refocusing again, & lt; Li & gt; The width is rediscovered:

    

It's done:

  & lt; Li class = "slide flex-active-slide" style = "width: 1088px; float: left; display: block," & gt; & Lt; Img alt = "#" src = "http://www.robotwp.com/clintenglish/wp-content/themes/clintenglish/images/samples/marley.jpg" & gt; & Lt; / Li & gt; & Lt; Li class = "slide" style = "width: 1088px; float: left; display: block;" & Gt; & Lt; Img alt = "#" src = "http://www.robotwp.com/clintenglish/wp-content/themes/clintenglish/images/samples/marley.jpg" & gt; & Lt; / Li & gt;   

The same behavior occurs in Chrome, Firefox and IE Explorer (all latest versions). I'm almost certain that this is an issue with your slideshow (or a feature?)

sed - Auto file names using awk -


I have a file named "FAI_4O57A", which has always three letters which are underscores and variable length digits from 1-7

I want to remove the first four characters and instead of my own number like 0000001 to 00001, I want to replace the second digit and so on. (For file names automatically number.).

How to use it awk Or sed will appreciate any kind of gratitude. Thank you.

Try doing this:

  rename -n '$ C ++; S / ^ (. {4}) * / Sprintf ("% s% 05d", $ 1, $ c) / e '[ag]] [aged] [ez] _ *   

you change the name of the test ,

See when your tests are OK ( dry run mode) to delete the -n switch).

ex: $ ls -1 DEF_FAI_4O58A FAI_4O57A FTH_4O59A box.py index.html robots.txt test.html $ Rename -n '$ c ++; S / ^ (. {4}) / Sprintf ("% s% 04d", $ 1, $ c) / E '[A-Z] [A-Z] [A-Z] _ * DEF_FAI_4O58A - & gt; DEF_0001 FAI_4O57A - & gt; FAI_0002 FTH_4O59A - & gt; If you really want to do this:

  printf '% s \ n' [AGED] [AGED] [AGED] _ [FTH_0003]   

* | Awk '{c ++; Edit : / P>

If you need to treat columns in YOUR_OWN_FILE :

  rename -n '$ c ++; S / ^ (. {4}) * / Sprintf ("% s% 04d", $ 1, $ c) / E '$ (awk' {print $ 2} 'YOUR_OWN_FILE)    

http - Passing basic auth username to a shell script -


I have a strange requirement that I have a webserver setup with http basic auth pass the user's name and / or password Any way to do a user enters the shell script with the environment?

I know that Apache has this information because I can see it in the access_log and error_log files. I am mainly interested in username, so I can store it in a txt files on a certified login

If you have PHP, then this information is available in $ _SERVER Super Global, so that you can do this:

  file_put_contents ('/ path / to / log / file', $ _SERVER ['REMOTE_USER']. "\ N", FILE_APPEND);    

javascript - Change User-Agent of audio tag -


I'm working on an HTML5 (not Flash) Shotastik Client For some streams, I have a < Code> & lt; Audio & gt; I can set the src of the tag and it plays just fine.

But there is a stream that does not work in that way because the URL of the stream is like the steam's index.html page, it uses a user agent If it's a browser, you get an HTML page; If it is not, you receive an MP3 stream.

Then, & lt; Audio & gt; How can I edit the request header sent by the browser when requesting a resource for the tag? I do not want to send this user-agent.

I do not think there is no way to change the user-agent but you can use SHOUTcast Finally, the semicolon ; By adding the service to the stream, SHOUTcast will ignore the user-agent.

HTML5 example:

  & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Body & gt; & Lt; Audio control & gt; & Lt; Source src = "http: //72.13.82.82-12100/;" /> & Lt; Em> Sorry, your browser does not support HTML5 audio. & Lt; / Em> & Lt; / Audio & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

You can http: //72.13.82.82-12100/; can verify the action by going directly to the browser. You should see some ICI metadata after MPEG stream.

c# - End Program After MessageBox is Closed -


At the beginning of my program, I am checking to see if I started a connection with the device on COM6 Can i If the device is not found, then I want to display a message box and then complete the program.

; } Hold {MessageBox.Show ("No Device Detected", MessageBoxButtons.OK, MessageBoxIcon.Error)} Application.EnableVisualStyles (); Application.SetCompatibleRenderingDefault (wrong); Application.Run (New Form 1 ());

When I try a message application. EXT (); After the message box command, the message box is displayed correctly when no device is found, but when I close the message box, Form 1 still opens, but is completely frozen and I Do not close it or click on any button, so that I should give an error because the device is not connected.

I'm just looking for the remote to kill the program after the message box is displayed. Thank you.

Solution: After returning MessageBox, the returns; left after using the method, like I wanted when this device was not plugged. However, when the device was plugged in, there were problems reading after testing. It was something I had not searched for before, but it was a simple improvement. Here's my fully working code:

  try {test = new reader ("COM6"); Test.Dispose (); // had to be settled so that I could connect later in the program. Simple fix} Hold {MessageBox.Show ("No Device Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error) Return; } Applications. Enabledview style (); Application.SetCompatibleTextRenderingDefault (wrong); Application.Run (New Form 1 ());    

Since it is in the main () routine, just return :

  Try {Reader = New Reader ("COM6"); } Hold {Messagebox.Show ("No Device Detected", MessageBoxButtons.OK, MessageBoxIcon.Error) Return; // will exit the program} application. Enabledview style (); // ... return to other code ..   

here will exit the process.

How to wrap objects printed by jQuery html() function individually -


आप यहां अपना कोड देख सकते हैं:

  $ (document) .ready (function ( ) {Var anchor_navigation_content = $ ('# content h1')। पाठ (); $ ('# एंकर-नेविगेशन')। Html (anchor_navigation_content);});   

मैं एक नेविगेशन बनाने का प्रयास कर रहा हूं जो स्वचालित रूप से प्रत्येक एच 1 टैग पर आधारित उत्पन्न होता है जो मेरे # सामग्री के भीतर दिखाई देता है प्रत्येक तत्व को व्यक्तिगत रूप से एक टैग के साथ लपेटा जाना चाहिए। हालांकि, मेरा कोड एक टैग में सभी तत्वों को लपेट रहा है मुझे यकीन नहीं है कि इस पर कैसे उबरना है I क्या कोई समझा सकता है? धन्यवाद!

इसका ध्यान रखेगा, आपको h1 को लपेट नहीं करना चाहिए एक a के साथ वैसे भी। इसे लपेटें।

  $ (दस्तावेज़) .ready (function () {$ ('# anchor-navigation')। Html ($ ('# content h1 ') .clone ()। WrapInner ("& lt; a href =' # '& gt; & lt; / a & gt;"));});    

RAILS: Availability of Resource after booking over period of time with calendar_for -


I am writing a booking system for rental of counts of revenue in the rail. As the owner of the resource, Together, wants to see the total amount of resources.

Mem is a good option for the calendar, except that I fail to find a way to show this percentage by time. Suppose the total resource is 100:

  • 20 units from 12-January-2013 to 20 February 2013
  • From 15-January-2013 Client-B books till 1-March-2013 30 units

    I want to see the booked capacity

    • 12-January-2013 to 14-January-2013 = 20% (Booking with client-A )
    • By 30th January 2013 - 20th February 2013 = 50% (20
    • From February 21, 2013 to March 1, 2013 = 30% (Booking from Client-B only

      Gradually, I collected these gems

      • Mani 'incident Mani 'table_builder'
      • Mani 'watu_table_builder'
      • Mani 'calendar_date_select'

        Below Code famous lesson Lascate # 213.

        index_calendar.html.erb

          & lt;% = @ date.prev_month.strftime ("% B% Y ")% & gt; & lt;% = calendar_for (@budgetings, year = & gt; @ date.year, month = & date; date.prev_month.month) do this; calendar | & gt; ; & Lt;% = calendar.head ('Sun', 'Mon', 'Mars', 'Mercury', 'Thor', 'Venus', 'Saturn')% & gt; & lt;% calendar.day : Day_method = & gt ;: from_date). Date, booking & Gt%; & Lt;% = date.day% & gt; & Lt; Ul & gt; & Lt;% for reservation in booking% & gt; & Lt; Li & gt; & Lt;% = link_to h (bookingcampetti), booking% & gt; & Lt; / Li & gt; & Lt;% end% & gt; & Lt; / Ul & gt; & Lt;% end% & gt; & Lt;% end% & gt;   

        is optional:

          & lt; Li & gt; & Lt;% = LINK_TO hour (booking.total_capacity (date)), booking% & gt; & Lt; / Li & gt;   

        I have tried to combine it with booking.rb two methods:

        It shows that the book From the percentage of units received-)
          def capacity @ a = Resource.find_by_id (self.resource_id) .units [(self.units/@a*100) .to_s + "%"] .   

        This shows total bookings only from ~ to_date
          DRF total_package (day) @ wall = booking.jux (: Resources). In the <{code}   

        booking model ("# {day}" and "time and time" :

      • :
      • :
      • :
      • :
      • :

        Resource Model <

        • : Units

          Thanks, Nick

          booking_days / index_calendar.html .rb

              

          The booking_days_controller.rb

            def was backed up with index_calendar @date = params [: month]? Date.strptime (parameter [months], "% Y-% m"): dend=@date.next_month.end_of_month rid = Resource.find_by_user_id Date.today dstart=@date.prev_month.beginning_of_month (session [: user_id]) .id sql = ["Select @row: = @row + 1 as the id, select ts.dat as the day, sum (from bookings.value) as the value" + "(choose the adapter ('# { Dstart} ', Numl000ki) as Dat "+" num1000 where adddate (' # {dstart} ', num1000.i) & lt; =' ts as # {dend} '), resource, " + "select booking JOIN (@row: = 0) R" + "where bookings.resources_id = resources.id and resources.id = # {rid} and adddate (bookings.from_time, -1) & lt; = ts .dat and ts.dat & lt; = bookings.till_time group Ts.dat "].] @booking_days Join = BookingDay.find_by_sql (sql) response_to do | Format | Format.html # index_calendar.html.erb format.json {render json: @booking_days} End End   

          Booking_days "On-Fly" has been created and is not stored in DB.

          The structure of Booking_day is {: id,: value ,: day}.

          The booking object is stored in DB and this structure is the basis of all the information shown in the calendar through the booking_day object: {_the_time ,: to_time ,: from_time ,: source_id ,: value_} .

          Number1000 = 0 ... 999

          nick