Sunday 15 July 2012

LoadRunner Referer option, what is it used for? -


Web_submit_data () या web_url () फ़ंक्शन के भीतर क्यों "रेफरर = myurl.com" प्रकट होते हैं

P> क्या यह किसी प्रकार के बेस-यूआरएल को लोडरनर को बताने के लिए है, जहां आप कह रहे हैं:

web_url ("कुछ", "URL = iamgoingtothisurl",

क्या है इस "रेफेरर" का उद्देश्य?

रेफरर तत्व एचपी, बुध या इनके द्वारा परिभाषित कुछ नहीं है LoadRunner, लेकिन यह HTTP और HTML के लिए प्रासंगिक आरएफसी द्वारा परिभाषित किया गया है,



java - How to save HashMap to a file and load it -


I have a big problem. I want to save a hushmap (I would say it 'map' or 'hm') In a file that is running on the Android device. I want to save it to internal storage.

I know that such questions were asked before 100 and I tried about 25 of them, but none of them worked.

I got 3 classes, one main square which extends the 'activity' and two other classes, one is called 'Usage'. I want to write two methods, to save and load a hashmap, and both methods should be in the 'use' class. In the main category, I've written several ways to load a Hashmap, put something in it and saved it again.

Even my problem should not be difficult to solve, but I also have 'saving' and 'load' methods in other classes except the main class.

I do not know how to get a contextual item in the other classes as a main square, so I do not know how to call openFileOutput () method.

In short: I want to save and load a hashmap from / from a file, which I want to build on internal storage. The method I use should be located in the 'use' class and should be accessible to all other sections, which have been liked in a steady manner. I tried many different possibilities but I always get 'FileNotFoundException'. I hope you can help me.

Some of the methods I used:

  try {FileOutputStream fos = c.openFileOutput (reference, reference. MODE_PRIVATE); ObjectOutputStream OOS = New ObjectOutputstream (fos); Oos.writeObject (hm); Oos.flush (); Oos.close (); Fos.close (); } Hold (FileNotFoundException e) {e.printStackTrace (); } Hold (IOException e) {e.printStackTrace (); }   

On this method, I have to use references, and I do not know how to get it into other classes. I also get 'FileNotFoundException' ...

  string file = path where my file should be located (I do not know how this should be given, but "data / data / [Packagename] / [File] "does not work) {FileOutputStream fos = new FileOutputStream (file); ObjectOutputStream OOS = New ObjectOutputstream (fos); Oos.writeObject (hm); Oos.flush (); Oos.close (); Fos.close (); } Hold (FileNotFoundException e) {e.printStackTrace (); } Hold (IOException e) {e.printStackTrace (); }   

This method does not work either, I really do not know what exception I got.

Finally: If you want to help me, please describe how to get each object (well, except the basic stuff, strings etc ...) and your complete solution Paste I really regret that before the question was asked, I could not find it.

Edit

I still have a 'FileNotFoundException' on the 'GetFilesDir ()' method ... I do not know what to do.

If you always Util -methods to a activity from the reaching class, just add context as a parameter to your method call.

Otherwise, you can create a global object, from which you can get a reference. It does not support the creation of special reference scenes and other activity-based options, but openFileOutput () / openFileInput () - the method should be fine because the directory is on the application -Livel

To do this, you create a sub-section of the application for yourself with a constant reference:

  // In the application sub-class: Fixed MyApplication Example; OnCreate () {super.onCreate (); Example = this; } Public stable last MyApplication getInstance () {return example; }   

Then you simply get a code of MyApplication.getInstance (); You can call .

You will also need to add your application - in the display class (with name-attribute under the application-tag).

Related reading:

php - parse a url, get hash value, append to and redirect URL -


I have a PHP foreground loop that is getting an array of data. A special array is an href in my resonance statement, I'm adding special href to my next page like this:
  echo & lt; A href = "nextpage.php? Url = '.ats.' '& Gt; Statistics & lt; / a & gt;'   

This redirects to my next page and I can get url by $ _GET. I get the problem after # in the appended url For example, the URL on the next page looks like this:

  stats.php? Url = basket-planet.com / ru / results / ukraine /? Date = 2013- 03-17 # Game-2919   

I want to be able to get #Games-2919 in JavaScript or jQuery on the first page, joining it with URL Go to the stairs.php page is this possible? I know that I can not get value after # in PHP because it is not sent to server side. Is there an alternative solution for this?

Here's what I'm thinking of:

  echo '& lt; a href = "#" onclick = "stats ('. '); "& Gt; Statistics & lt; / a & gt; '; & lt; script type =" text / javascript "& gt; function statistics (url) {var hash = window.location.hash.replace (" # ", ""); Alert (hash);}   

but it is not working, I have not received any warning, so I can not try AJAX and do not redirect to the next page Thank you in advance.

Update: This is my complete index.fp page.

  & lt ;? php include_once ('simple_html_dom.php'); $ Html = File_get_html ('http://basket-planet.com/ru/'); $ ($ Games-> ($ stats = $ games-> Children (5) - foreach ($ html- & gt; Search ('div' [class = games] div [class = games-1] div [class = Game] ')' gt; & gt; href; echo & lt; table? & Lt; tr & gt; & lt; td & gt; & lt; a href = "stats.php? Url = http: //www.basket- Planet.com '.stats.' & Gt; Figures & lt; / a & gt; & lt; / TD & gt; & lt; / tr & gt; & lt; / table & gt; ';}? & Gt;   

My stats.php page:

  & lt ;? php include_once ('simple_html_dom.php'); $ Url = $ _GET ['url']; // $ hash = $ _GET ['hash']; $ Html = file_get_html (''. $ Url. ''); $ Stats = $ html-> Search ('div [class = fullStats]', 3); // $ stats = $ html- & gt; Search ('div [class ='. Hash. ']'); Statistics stats; ? & Gt;   

What I want to be able to do is add the hash to the URL which goes to stats.php. There is no code because I am using simple HTML DOM parser. I pass that hash to the stats.php URL to look through the URL. Hope this helps ... ...

When you generate HERF, urlencode in PHP Use to be part of a hash when the user clicks on the link, then the browser is not abandoned:

index.php:

    

Then on the second page, part of the hash outside the URL.

stats.php:

 < Code> & lt; php Include_once ('simple_html_dom.php'); $ Url = $ _GET ['url']; $ Parars_url = parse_url ($ url); $ hash = $ parse_url ['piece']; $ Html = file_get_html ('' $ Url. ''); // $ stats = $ html-> Search ('div [class = fullStats]', 3); $ Stats = $ html- & gt; Search ('div [ Class = ' $ Hash. ']');); Stats Statistics;? & Gt;    

java - JAX-WS port from WSDL -


So I'm trying to connect to a Jeads- the WS imported Dblyuesdiel client when I webservice endpoint, Jeads- The WS client tries to load WSDL. Why this?

  • I do not want to store the WSDL in my project,
  • I do not want to load again From webservice URL to WSDL?

    Question :

    • Is there any chance of this behavior?
    • How to add webservice endpoint URL to runtime?

      Adding a port with the same QName and port name fails, because I can not add it, it is ok to add a separate port, but I can not get it from the webservice rep, because the WSDL Does not include additional port definitions.

      JAX-WS seems to be completely incorrect: (

      today you are in luck. one way is, as you mentioned.

        QName qname = new QName ( "http: // thenamespace", "FooService"); FooService service = new FooService (zero, qname); // WSDL file null Foo port = service.getFooPort (to ignore); BindingProvider BindingProvider = (BindingProvider) port; bindingProvider.getRequestContext (). input (BindingProvider.EndPOINT_ADDRESS_PROPERTY, "http: / /foo.com/soap/fooBean "); The use of the service obj = port.do something (the ultimate);    

c - fuse: How do I get the size of the file that is going to be written before it's written? -


When a file is written, write with the function .write In fuses_operation is called for each file segment

This means that for a large file (for example 12720 bytes), the writing task is 4 times

  1 can be said size = 4096, offset = 0 2. size = 4096, offset = 4096.3 size = 4096, offset = 8192 4. size = 432, offset = 12288   

Because it has 4 segments, maximum segment 4096 bytes with size

Under the write function, I would like to determine when the last segment size is write n I intend to keep all segments in buffer , And to use this last written section to indicate that the buffer is now the whole object, so that it can be placed elsewhere (such as an object store). Knowing the size of the object to be written before writing, I can do just one simple parity test file_size == size + offset to determine when the last section is being written I am

Obviously, I can not After the handler closes, I can just insert the whole object elsewhere (such as an object store).

javascript countdown synchronize on different browsers -


I'm sorry, if this question is a bit difficult, but I have no other way to ask it and I have a complete Not JavaScript in the world

I have this JavaScript counter that someone helped me to collect on the StackViewflow and it works fine but the countdown timer will start from the beginning on a different browser.

When I see it on Firefox, it will count down and it will continue to work as much as we want we say that the timer is set to countdown one day. It will save 23:24 hours / minute on Firefox, but if I open a new browser (any browser), then this timer will save 23:59 hours / min and it will start counting from there ... yet Counterdown timer was already running on the same page !!

Here is the code:

  & lt; Script type = "text / javascript" & gt; Var EXPIRY = parseInt (new date). GetTime () / 1000) + 24 * 60 * 60; Var Counter = Faucet; Var counter_interval = null; Function set cookie (name, value, day) {console.log ("setting" + name + "" + value); Termination of the year; If (day) {var date = new date (); Date.setTime (date.getTime () + (Days * 24 * 60 * 60 * 1000)); Ends = "; expires =" + date.toGMTString (); } And {end; = ""; } Document.cookie = name + "=" + value + finished + "path = /"; } GetCookie function (name) {var nameEQ = name + "="; Var ca = document.cookie.split (';'); For (var i = 0; i & lt; ca.length; i ++) {var c = ca [i]; While (c.charAt (0) == '') {c = c.svstring (1, c.length); } If (c.indexOf (nameEQ) === 0) {return c.substring (nameEQ.length, c.length); }} Return tap; } Function deleteCookie (name) {setCookie (name, "", - 1); } Function resetCounter () {EXPIRY = parseInt (new date). GetTime () / 1000) + 24 * 60 * 60; } Stopper () {window.clearInterval (counter_interval); DeleteCookie ('termination'); } Function updateCounter () {var msg = ''; Curium = purseInt (new date). Meet-time () / 1000); If (Curtimes & lt; EXPIRY) {msg = ConvertSeconds (EXPIRY - curtime); } And {EXPIRY = parseInt (new date). GetTime () / 1000) + 24 * 60 * 60; } Var el = document.getElementById ('counter'); If (L) {el.innerHTML = msg}} function convert from canttoode (sec) {var day, hour, rim, minute, second; Day = purse (sec / (24 * 3600)); Rim = sec - day * 3600 hours = persian (rim / 3600); Rem = rem-hours * 3600; Mins = parseInt (rim / 60); Secs = rem - mins * 60; Return day + ":" + hour + ":" + minute + ":" + seconds + ""; } Function startCounter () {stopCounter (); SetCookie ('End', EXPIRY, 1); Counter_interval = window.setInterval (Update Counter, 1000); } Function init () {EXPIRY = getCookie ('termination'); If (! EXPIRY) {console.log ("Unable to find cookie"); reset counter(); } Startcounter (); } in this(); & Lt; / Script & gt;   

You can see here at Bela:

How can I create it that it will save all browsers at the same time as it will be displayed on the same page can be done?

Thanks

Edit:

I found this code that works with mysql. It works fine but instead of count down, it will show how many days / hours / minutes the product / item was posted on the site. And there is no javascript required for this ...

What kind of searches I'm looking for but instead of counting it requires a countdown:

  & Lt; Php // list fields and seconds $ countdown ['days'] = (5) * convert to 24 * 60 * 60; $ Countdown ['hours'] = (3) * 60 * 60; // etc, etc. $ countsum = time () + $ countdown ['day'] + $ countdown ['hours']; // and so on // timestamp to enter the table above ########## Includes "config / connect_to_mysql.php" in the query 'dumbed down'; $ Result = mysql_query ("SELECT * tomProduct WHERE id = 'id';"); While ($ line = mysql_fetch_assoc ($ result)) $ time = $ line ['date_added'] - time (); // This field will be a php timestamp (time ()) $ count = getdate ($ time); $ X = getdate (); // Today's information is $ count ['mday'] - = $ x ['mday']; $ Count ['hour'] - = $ x ['mday']; $ Count ['min'] - = $ x ['min']; Echo "count of $ count [mday] day [hour] hour calculation $ min [minutes] minute"; // etc // unchecked, but should work? & Gt;  

Javascript is always running on the client The other example is no knowledge .

To synchronize the time between different browsers, you will need server-side scripts Using the Expression-Time-Stamp in a server-side script combining JavaScript with timer to give you that synchronization What you are looking for

c# - Building Visual Studio projects for 2 Frameworks Simultaneously -


I have some class libraries that I'm using in my two in-house projects, one of the in-house projects Targets the .NET 4.0 framework , while the second targets a .NET 2.0 . I am using 2.0 project to get some Naxalites of higher version .NETs.

To properly use class libraries in both projects, I need to compile a version (using LinqBridge) for .NET 2.0 Framework, and another version for .NET 4.0. (Using standard System.Linq).

I want to save myself from doing this manually. I was hoping that there was a way to specify what is the current target structure in the Build Events section, but it seems that there is no macro for this. I'm not familiar with manually building the editing configuration manually

I will create two different projects in one solution only, for a 2.0 And for a 4.0 goal They can refer to the same source files and add additional references to 2.0.

This allows you to prepare solutions and get both 2.0 and 4.0 goal DLL so that you can include in other projects

c# - No mapping exists from object type system.io.memorystream to a known managed provider native type, Windows XP only issue -


त्रुटि प्राप्त हो रही है: System.argumentexception: कोई मैपिंग ऑब्जेक्ट प्रकार system.io.memorystream से एक ज्ञात प्रबंधित प्रदाता देशी प्रकार से मौजूद नहीं है।

मेरा कोड Win7-64bit पर ठीक काम करता है, लेकिन WinXP-64bit में नहीं।

त्रुटि तब आती है जब वस्तु को KeyValuePay में पास किया जा रहा है प्रकार या मेमोरीस्ट्रीम और SQL doesn यह कैसे संभाल करने के लिए पता नहीं है।

सवाल में कोड है:

  foreach (keyvaluepair & lt; frmmain.PARAMS, ऑब्जेक्ट & gt; आइटम paramDictionary में) {sqlCMD.Parameters जोड़ें (नया SqlParameter ("@" + item.Key.ToString (), item.Value)); }   

संदर्भ के लिए यह कॉल करने वाला कोड है:

  mStream = frmRptViewer.CryRpt.ExportToStream (CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); शब्दकोश & lt; PARAMS, ऑब्जेक्ट & gt; PdfDictionary = नया शब्दकोश & lt; PARAMS, ऑब्जेक्ट & gt; (); PdfDictionary.Add (PARAMS.TYPE, "PDFSAVE"); PdfDictionary.Add (PARAMS.PDF, एमस्ट्रीम); PdfDictionary.Add (PARAMS.JOBNUMB, नौकरीटैक्सबॉक्स। पाठ); PdfDictionary.Add (PARAMS.LINENUMB, लाइन न्यूटैक्सबॉक्स। पाठ); DBCall.SavePDF (pdfDictionary);    

सबसे अधिक संभावना है कि यह स्ट्रीम वर्गों को नियंत्रित नहीं कर सकता है। आप बाइट [] का उपयोग करने की कोशिश कर सकते हैं, जिसके बजाय MemoryStream आपको आसानी से करने देता है:

  pdfDictionary.Add (PARAMS.PDF, mStream.ToArray ());   

आप रिसाव को रोकने के लिए का उपयोग करके स्ट्रीम को लपेट करना चाहते हैं:

  का उपयोग कर ( मेमोरीस्ट्रीम mStream = frmRptViewer.CryRpt.ExportToStream (CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)) {शब्दकोश & lt; PARAMS, ऑब्जेक्ट & gt; PdfDictionary = नया शब्दकोश & lt; PARAMS, ऑब्जेक्ट & gt; (); PdfDictionary.Add (PARAMS.TYPE, "PDFSAVE"); PdfDictionary.Add (PARAMS.PDF, एमस्ट्रीम); PdfDictionary.Add (PARAMS.JOBNUMB, नौकरीटैक्सबॉक्स। पाठ); PdfDictionary.Add (PARAMS.LINENUMB, लाइन न्यूटैक्सबॉक्स। पाठ); DBCall.SavePDF (pdfDictionary); }    

validation - What is the right way to replace an entire html code block from a structure? -


My problem is that I have one text field with one that has a wysiwyg editor.

Now, when the user presents the form and does not enter anything in the field then this is what is posted: & lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-end-marker" gt; & Lt; / Span & gt; & Lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-start-marker" & gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; Br> & Lt; / P & gt;

Now, I want to require the field, and want to verify that the field is empty or not, but it is never really empty, because the editor is using that html Is located in

So though I would like to do something like this:

  & lt; For cfset search = "& amp; lt; span class = & amp; quot; sceditor-select & amp; quot; style = & amp; quot; line-height: 0; display: none; & amp; quot; ID = & amp; quot; sceditor-end-marker & amp; amp; & quot; & amp; gt; & amp; lt; / span & gt; & amp; duration class = & amp; quot; sceditor- Selection & amp; quot; style = & amp; quot; line-height: 0; display: none; & amp; quot; id = & amp; quot; scanner-start-marker & amp; quot; & gt; Amp; lt; / span & amp; gt; & amp; lt; p & gt; & lt; br & gt; & lt; / p & gt; "& gt; & Lt; Cfif StructKeyExists (params.event, "summary_an") & gt; & Lt; Cfset 'params.event.summary_en' = Change ('params.event.summary_en', '#searchfor #', "", "All") & gt; & Lt; / Cfif> & Lt; Cfif params.event.summary_en eq "" & gt; Error & lt; Cfelse & gt; Process & lt; / Cfif>   

However, the above params.event.summary_en "" or [empty string] does not set, as I want, params inside this parameter.Avent. Transfers to summary_en. Event.summary_en

So for some reason my above code is changing: & lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-end-marker" gt; & Lt; / Span & gt; & Lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "scadder-start-marker" & gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; Br> & Lt; / P & gt;

With this: params.event summary_yes

Why any idea is happening, and if I correctly state this recognition Am going about

Thank you.

The code below gives 'error' on CF10, 282462 which version of CF you use are doing?

  & lt; Cfset params.event.summary_en = '& lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-end-marker" gt; & Lt; / Span & gt; & Lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-start marker" & gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; Br> & Lt; / P & gt; '/ & Gt; & Lt; Cfset searchfor = '& lt; Span class = "prescriptor-selection" style = "row-height: 0; display: none;" Id = "sceditor-end-marker" gt; & Lt; / Span & gt; & Lt; Span class = "sceditor-selection" style = "row-height: 0; display: none;" Id = "sceditor-start marker" & gt; & Lt; / Span & gt; & Lt; P & gt; & Lt; Br> & Lt; / P & gt; '& Gt; & Lt; Cfif StructKeyExists (params.event, "summary_an") & gt; & Lt; Cfset params.event.summary_en = Change (params.event.summary_en, Search, "", "All") & gt; & Lt; / Cfif> & Lt; Cfif params.event.summary_en eq "" & gt; Error & lt; Cfelse & gt; Process & lt; / Cfif>    

c# - Timing delays using Schedule for NServiceBus -


While using the schedule method for NServiceBus, I see that there is a continuous delay between passed jobs. If my interval is up to a minute, instead of looking at the next job, just one minute away, an additional 5 seconds delay seems to be.

If I set my intervals down in just one second, the additional delay is also 0.7 seconds. The delay in running for more than a minute lasts for about 5 seconds.

There is a code snippet using the minute interval:

  previousTime = DateTime.Now.TimeOfDay; Schedule. Every (Timespane. FormsCunds (60)) Action ((=) = {DateTime timeout = datetime.Now; Servicebus.WitToAlAug (string format ("Start of schedule: {0}, {1} delay" current time, Current time, timeoff - previous time); previous time = date time.Now timeoffs;});   

There is a snippet from my logs:

2013-03-26 12: 20: 58,483 [3] Information rolling file adder [(empty)] - Start Schedule: 3/26/2013 12:20:58 PM, 00: 01: 04.99 31640 Delay

2013-03-26 12: 22: 03,514 [19] Information rolling file papers [(empty )] - Start of schedule: 3/26/2013 12:22:03 PM, 00: 01: 05.0302735 delay

2013-03-26 12: 23: 08,532 [4] information rolling file adapter [( Blank)] - Start of schedule: 3/26/2013 12:23:08 PM, 00: 01: 05.0185546 Delay

2013-03-26 12: 24: 13,553 [3] h Information rollingfile operator [(empty)] - Start of Schedule: 3/26/2013 12:24:13 PM, 00: 01: 05.0206625 Delay

2013-03-26 12: 25: 18,577 [ 4] Information rollingfile operator [(empty)] - Start Schedule: 3/26/2013 12:25:18 PM, 00: 01: 05.0244141 Delayed

2013-03-26 12: 26: 24,451 [22] Information rollingfile operator [(empty)] - Start Schedule: 3/26/2013 12:26:24 Prime Minister, 00: 01: 05.8740234 Delay

2013-03-26 12: 27: 28,695 [3] information rolling wallpaper apple [[empty]] - start Schedule of: 3/26/2013 12:27:28 PM, 00:01:04 .2441406 Delayed

2013-03-26 12: 28: 33,739 [22] Information rolling wallpaper apple [(empty )] - Beginning of schedule: 3/26/2013 12:28:33 PM, 00:01: 05.0439454 Delay

2013-03-26 12: 29: 38,753 [4] Information rolling file appleer [( Blank)] - Start of schedule: 3/26/2013 12:29:38 PM, 00:01: 05.0138266 delay

2013-03-26 12: 30: 39,029 [19] information rolling file appleer [(Empty)] - Start of schedule: 3/26/2013 12:30:39 PM, 00:01: 00.2757029 delay

2013-03-26 12: 31: 43,878 [19] Knowledgeable The rollingfile operator [(empty)] - Start of schedule: 3/26/2013 12:31:43 PM, 00:01: 04.8492417 delay

2013-03-26 12: 32: 48,951 [4] ] Information rollingfile appleer [(empty)] - Start of schedule: 3/26/2013 12:32:48 PM, 00:01: 05.0732422 delay

2013-03-26 12:33 33: 53,950 [ 3] Rolling file information [empty] - Start of schedule: 3/26/2013 12:33:53 PM, 00:01: 04.9 9 90235 delay

2013-03-26 12: 34 : 58,950 [3] information rollingfile operator [(empty)] - Scheduled to start: 3/26/2013 12:34:58 PM, 00:01: 0 4.9999930 Delay

2013-03-26 12: 36: 03 9 50 [3] Information rolling file opener [(empty)] - Scheduled to start: 3/26/2013 12:36:03 PM, 00: 01:05 Delay

2013-03-26 12: 37: 08 970 [22] Information rolling wallpaper [[empty]] - Start of schedule: 3/26/2013 12:37:08 PM, 00: 01: 05.0195313 Delay

2013-03-26 12: 38: 10,185 [22] information rolling file operator [(empty)] - Beginning of schedule: 3/26/2013 12:38:10 PM , 00: 01: 01.2150069 Delay

2013-03-26 12: 39: 14,354 [3] Information rolling file opener [(empty)] - Beginning of schedule: 3/26/2013 12:39:14 PM, 00: 01: 04.1694596 Delay

I have raised a problem in jihab to fix this, see P> If you have an interval < = 1sec, you will not have 5sec delay because we bypass voting and execute that code.
So 0.7sec delay executes the code directly.

jquery - Many modal windows with large strings -


Using twitter bootstrap, my In the Net MVC App, I have a scene that pulls many areas. The value of each field is 100 characters long. The original string is always greater than 1000 characters long (sometimes 100k characters long).

  string length = result [i]; // is actually a long string which is longer than 1000 characters long = long Shuttle (0, 99); & Lt; Section & gt; & Lt; Div class = "line-fluid" & gt; & Lt; Div class = "span12" & gt; @ Short & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Section & gt;   

For every field that I want to draw, I should have a link that the user can click to show a model window in which I display small text.

So I should have 100 links in the normal window on the same page and every modal window will display its own text.

Something like this:

But my problems are:

1) I have many modal dialogs on the same page, so I think that I Will need a unique ID.

2) Text in every modal dialog ("string long") I might long to do when I drag them into client code, or maybe I can do this by sending long text to my controller I am I'm not sure what the best way would be.

I see this: But I do not understand what the answer to the inquiry ("Lunch Dialog Suggestions") is mentioned. One possible strategy is to have HTML only for a modal dialogue, and all its long versions are. Some types of JavaScript data structures, such as strings, such as a hash array or something else can cause your page to be swamped by HTML for hundreds of modal communication

Then, when the user 'shows me a tall version' link Clicks - you have some questions that change the internal text within the model, the dialog with the proper length of the string that receives from the hash array and then The dialog displays.

If you want to get a fancy - you will only load a small version of the string page, and when the user clicks on the link, it will retrieve the 'long version' of the string through AJX Will do

Twitter comes with Bootstrap Model Dialog, and there are a few ways to insert HTML in jQuery elements - see.

If you see the documentation for Twitter Bootstrap modal dialog, you will see that it can optionally load data via AJAX using the Remote: option.

This is a very good example of how you can use Twitter Bootstrap to do via AJAX

Controller

  Public ac TionResult index () {var model = GetLongStrings (); See Return (Model); } Public Action Search Long string (string short string) {var longStrings = GetLongStrings (); Var longStringToReturn = Length strings. First with the default (x = & gt; x.Starts (shortString)); Return content (Long string tutorial); }   

Then, something like this will appear in your view

  @foreach (result in result) {var shortString = result.Substring (0, 5); & Lt; Section & gt; & Lt; Div class = "line-fluid" & gt; & Lt; Div class = "span12" & gt; @ ShortString & lt; / Div & gt; @Html.ActionLink ("see long version", "search long string", new {shortString = shortString}, new {data_toggle = "modal", data_ target = "#mymodal", aria_hidden = "true"}) & lt; / Div & gt; & Lt; / Section & gt; } & Lt; Div id = "mymodal" 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 & gt; Modal Header & lt; / H3 & gt; & Lt; / Div & gt; & Lt; Div class = "modal-body" & gt; & Lt; / Div & gt; & Lt; Div class = "modal-footer" & gt; & Lt; A href = "#" class = "btn" data-rejected = "model" & gt; Close & lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

The data features are important in the ActionLink because they direct Twitter Bootstrap to see which option to use for your dialog.

The code example can be improved if each string can accept an ID - FindLongString as a paragraph, which means that you pass it just in ActionLink can do.

unexpected symbol in R please see the code -


I was trying to write a function to parse and merge some data. But R throws an unexpected symbol error exception. I have tried different ways to solve this issue, still does not work. help please.

See the code

  $ aggall = function (df, grp) {numcols = sapply (df, class)% c% c ('integer', 'numeric') The result = total (df [, numcols], df [grp], mean) calculation = as.data.frame (table (df [grp]) name (count) [1] = grp merge (calculation, result error: " Ungrouped symbol {aggall = function (go, grp) in {numcols = sapply (go, class)% c in% c ('integer', 'As a result, your physical work is in a physical line.) Therefore, when  R  tries to parse it, this is not a method when a line ends and the next one starts  

To fix this, either use separate lines or add a semicolon between them.


Alternatively, you can see the FormatR package can do for you! (Very Awful Package): install.packages ("formatR") library (formatR) tidy.source (" Mysource.r ", reindent.space = 5) aggall = function (df, grp) {numcols = sapply (df, class)% in% C (" integer "," numeric ") results = total (df [, numcols] , Df [grp], mean) calculation = as.data.frame (table (df [grp]) name (count) [1] = grp merge (calculation, result, sort = FALSE)}

python - Complex Query: Select latest object from every day, or if present, a flagged object -


OK, so I'm working with a blog (Zinnie) and there are model entries. Special query should be prepared:

  1. Select at most one entry per day.
  2. If an entry is marked "special", then select it
  3. otherwise select the latest

    aligned model:

      class EntryAbstractClass (models.Model): "" "Designed for base model publishing entries" "" creation_date = models.DateTimeField (_ ('creation date'), default = timezone.now) start_publication = models.DateTimeField End_publication = models.DateTimeField (_ ('end publication'), empty = true, zero = true (_ ('start publication'), empty = true, zero = true, help_text = _ ('date start publish')) , Help_text = _ ('Date end published')) = m Dal. BooleanField (_ ('special'), default = false)   

    To make things even more complex, the entry date used for "latest" is:

      if start_publication! = None: latest_data = start_publication Other: latest_data = create_data   

    I'm not sure how I will do this in SQL, very few DJanga filters. any idea?

    Hmm, maybe using Q object? I'm not sure that I believe 100%, see this:

    How to do something like this (completely unprotected):

      datetime import datetime to django.db Model Import Q filter = Q () # If there are no featured filters == (Feature = True) # Or if it was the "Publish" filter today = Q (start_publication__day = datetime.today ()) # or if it was "made" filter today. = Q (creation_date__day = datetime.today ()) # one entry_of_de_de_yyll = entries.obages Filter (filter) [: 1]    

ember.js - why am i seeing "error while loading route" with ember? -


Amber RC1, Amber-Data Amendment 12. All my routes are loading correctly, unsure why I I am seeing this error when I try to use the show route ie. Corrected / files / groups / 5 index paths

I have pasted the stack trace below but it is not very informative

  this.resource ('files', {path: 'i / Files'}, function () {this.resource ( 'groups', {path: '/ groups'}, function () {this.route ( 'show', {path: '/: asset_link_group_id'});});}); AssetLinksApp.GroupsShowController = Ember.ArrayController.extend ({content: Ember.A (), assetLinkGroup: null}); AssetLinksApp.GroupsShowRoute = AssetLinksApp.AuthRequiredRoute.extend ({setupController: function (controller model) {controller.set ( 'content', model.get ( 'asset_links')); controller.set ( 'assetLinkGroup', model);} , Model: Functions (Parameters) {Return Assetlinks App. Asset Link Group. FIDD (Params.asset_link_great_id_id);}});   

Stack trace:

Error route loading: typos {} exchange_vendor.js: 12078

(Anonymous Ceremony) exchange_vendor .js: 12078 amber Rotor.openclass.filefileherhandler Setup exchange_windore JS: 35011 Failure exchange_videador. JS: 34448 Objects.Cake.Cantex Exchange_Window JS: 34497 Avoc Callback Exchange_Window JS: 17846 Promos. Then exchange_windore. JS: 17893 Event Target. Trigger exchange_viveador. JS: 17822 results exchange_windore. JS: 17 9 24 Run Loop Retrospective exchange_wevdor JS: 15 911 Amber Handeliers Exchange_Vender. JS: 12140 exchange exchange_viveador. JS: 15 9 9 ITAR Exchange _Windows JS: 15 9 81 runs loop.flish exchange_wonder. JS: 16035 runs loop Finally exchange_vendor.js: 15,940 tryable exchange_vendor.js: 16,143 Ember.tryFinally exchange_vendor.js: 12831 Ember.run.end exchange_vendor.js: 16146 Ember.tryFinally exchange_vendor.js: 12833 Ember.run exchange_vendor.js: 16102 Ember.HashLocation. Mberkobjekt.akstendkonupdteurl Akschenj_venderkjas: 36,690 JQuerykiventkdispac Akss Hnge_venderkjas: 3144 JQuerykiventkaed.alemdaatakhandl.aventndle

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

The model returns a single record even though you have defined the ArrayController .

Ember.js automatically keeps the model in the property of the controller's content, causing the error to occur because it will maintain a record in an array of controllers.

Although you override the setupController , before it fires, amber.js will place the model in the controller anyway. Currently there is no way of stopping


update 3-Jun-2014 (amber> 1.0) :.

Now the override then setupController amber no longer sets the property model .


The only solution I can think is to add resources to our routes:

  This.resource ('files', {path:' / files'}, function () {this.resource ( 'groups', {path:' / groups'}, function () {this.resource ( 'group', {Path: '/: asset_link_group_id'}, function () {This.route ('index');});});});   

This means that you have an object controller ( GroupController ) group containing, and code an array controller (<> GroupIndexController ) with each link Array AssetLinksApp.GroupIndexController = Ember.ArrayController.extend ({assetLinkGroup: null}); AssetLinksApp.GroupIndexRoute = AssetLinksApp.AuthRequiredRoute.extend ({setupController: function (controller model) {Niyntrkkset ( 'content' model); Niyntrkkset ( 'AssetLinkGroup, ThiskmodelFor (' Group '));} , Model: functions (parameters) {return.modelfor ('group'). Get ('asset_links');}});

Your template should now be named group / index instead of groups / show . For the group template, this can be an empty template containing {{outlet}} .

This is worth noting that the most important thing: If your controller is an object controller, model hook object back , and if your controller array controller, you to return an array of model hook.

The bright side, it is better that pushes you to follow a certain design I might think of the core team.

Kendo datepicker shows two months during animation -


With Kendo Dedekker, we are looking at stacked two months on each other when we are transitioning months whether anyone else Have seen this? It happens in both Firefox and Chrome.

  $ ("datepicker"). Candodeate Picture (); From & lt; Input type = "text" id = "OrderDateFrom" class = "datepicker" name = "OrderDateFrom" />   

As soon as the transition is completed, it normally looks again.

Update: Using the latest version of the Cando UI Web v2013.1.319, Windows 7 OS, Firefox, Chrome, IE 9 & amp; 10, JQuery 1.9.1, HTML5, MVC 2

The dynamically created table element by the Conduit Picture plugin has any clear CSS rules may not apply IE: clear: both;

Using a USB printer with C#, with and without driver or API -


I'm not really C # expert, I did something funny like a piano roll for the concert, WPF canvas all Mathematics and such) and some simple programs to perform common tasks such as expanding some data on the fly (math operations, GUI interactions, etc.). I need a very general overview of how I know I can install a USB computer on my computer I and I work with it. I have already searched here and on Google, and this is what I found:

/ P>

OK, what I came here (I have as short as possible):

A) To use a printer without drivers (this definition can not be accurate, But i am a little ul I'm in ...)

I want to:

1) Find a way to detect the USB doors and which device they are associated with the product In the special case of Id and Seller ID Developer Fusionarticle, the author tells a few basics of US and asks you to use the Human Interface Device to find out. (I'm using windows 7 and no one can hide me, just another random USB drive, and I do not have any way to interact with them)

2 ) Create a stream of data and send them the USB printer with commands on the correct message pipes (or whatever device you want is the pilot intent).

B) To use a printer with drivers or window APIs or preeded drivers:

I want to:

1) [MSDN system. Printing Libraries] [Link Number 6] and pilot systems directly to the printer (later) device By using the right methods from those sections ...

OK, by creating a point:

I'm not really IDEA on which the right steps are, And this is that I am trying to ask you:

How to do it, it is a step by step, especially the first one (as I looked at the question of MSDN platform Second, it is actually a matter of studying the code). I do not want you to write the code for me (though you can do so). I'm just asking for a general guideline on which the right steps are to get the final result. Post links, whatever works ...

This answer is for choice A

Really difficult problem is by reaching lower level hardware, it is much harder than such high-level programming language. It used to use the assembly, which was Can regulation is only one thing I can think is that good wrappers for C # provides direct access to USB devices such as printers. To get started with a good C # easy USB devices will be able to hang it.

>

active directory - PowerShell v2.0+ add a computer to a domain global group -


I am using PowerShell version 2.0 and want to know how to make a domain computer A Domain Global Group.

In addition to this, I would like to know that it has a good site to go to, which has V2 commands and examples.

I know that this is a little late but, if you have PowerShell < Code> Active Directory You can use Modulde to do this to PowerShell 2.0 :

  import-module activation $ $ globalGroup = "Your_Global_Group" $ ComputerName = "computer name" $ ​​computerObj = Get-ADComputer $ computer name - properties * add-adgroup member-indentity $ global groupmember $ computerObj.DistinguishedName   

note < / Strong>: You Active Directory Programmed to be turned to use the windows feature activedirectory module can be found under the 'Saver Remote Administration Tools "tab in Windows features.

link:

android - ProgressBar ontop of TableLayout -


I am trying to close my progress above a table layout.

Code:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; LinearLayout xmlns: android = "Http://schemaskandroidkcom/apk/res/android" Android: Layout_width = "Fill_parent" Android: Layout_height = "Fill_parent" Android: baselineAligned = "false" android: orientation = "vertical" & Gt; & Lt; ProgressBar Android "Android: attr / progressBarStyleLarge" id = "@ + id / bar_Update" style = Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" android: padding = "250dp" Android: visibility = "visible" / & Gt; & Lt; ScrollView android: id = "@ + id / ScrollView01" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" & gt; & Lt; Android: layout_height = "wrap_content" android: shrinkColumns = "*" Android: stretchColumns = "*" Android: Gravity = "center_horizontal" Android: layout_gravity: TableLayout Android: id = "@ + id / tableLayout1" Android: layout_width = "fill_parent" = "Top" & gt; & Lt; TableRow android: id = "@ + id / rowtolele" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" & gt; & Lt; TextView android: id = "@ + id / title" Android: Layout_width = "Fill_parent" Android: layout_height = "60px" android: gravity = "center" android: text = "Unterichtsausfall: \ n" Android: textSize = "20 DP "Android: Textstyle =" Bold "Android: Typeface =" Serif "& gt; & Lt; / TextView & gt; & Lt; imageView android: id = "@ + id / imgUpdate" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: adjustViewBounds = "false" Android: baselineAlignBottom = "false" android: clickable = "true" Android : Src = "@Drawable / Refresh" /> & Lt; / TableRow & gt; & Lt; / TableLayout & gt; & Lt; / Scrollview & gt; & Lt; / LinearLayout & gt;   

I in your code to display the progress bar at the top of the layout Set visibility (see. Visual) I am using , but it does not work is. Gone to display it, I'm using setVisibility (see. INVISIBLE) . What am I doing wrong? My goal is to get data from the internet right now showing the spinner. As soon as the data is received, it is displayed in the table and the spinner goes.

Thank you!

"" on top and "above" generally means that Usually, on the 'top' it usually means the graphics given below is included, because one usually wants to do one progress with Barrar.

'Up', usually above the top of the screen means high, so that ScrollView and Table layout will be close to the bottom of the screen.

If your progress was 'at the top', then see . INVISIBLE will be OK. But, your progress bar is above the layout below. Therefore, the way you have implemented, you should set it to View.GONE to hide it.


If you want to display the progress bar, the 'over the top, or your layout over the bottom, the top-level layout of a RelativeLayout a LinearLayout instead.


In the end, I do not understand what is wrong. Is not actually working with your layout or code behavior?

javascript - Is it possible to create unzoom element in Raphael? -


I have a Rafael paper that works like Google map.

Like a map, there is a main content, and many overlays engage on top of it, like those pins and markers on Google pin.

So when I'm zooming, I want the main content to zoom in, and take those overlays to the right position but stay in the original size. (For example, in Google Maps, when I zoom a city, those overlays will always be attached to the correct address on the screen with the same size).

I am currently creating thousands of papers, and keeping my position on manually zoomed but due to this there are so many things, so it is interesting to know if it is possible to remove everything in one paper is. And while zooming, do some magic to stop those elements. Something like:

  paper. True (0, 0, 10, 10) .attr ({resize: false})    

< P> You only need two papers on each other, while zooming down the paper, use setViewBox on top paper, recalculate posts and translate ( .transform (' T ...) ) Each element

delphi - How do I show the Windows photo-printing wizard on windows XP? -


Hello, can I use Delphi 2010 + Windows XP, you call Photo Printing Wizard in Windows XP to Delphi.

This tip only works on windows 7

Thanks.

For the sample code include:

  static const CLSID CLSID_PrintPhotosDropTarget = {0x60fd46de, 0xf830, 0x4894, {0xa6, 0x28, 0x6f, 0xa8, 0x1b, 0xc0, 0x19, 0x0d}}; // A data object that has a list of photos to print. IDataObject * pDataObject; // Create photo printing wizard drop target. CComPtr & LT; IDropTarget & gt; SpDropTarget; Hr = CoCreateInstance (CLSID_PrintPhotosDropTarget, zero, CLSCTX_INPROC_SERVER, IID_PPV_ARGS (& amp; spDropTarget)); // Drop data object on drop target POINTL pt = {0}; DWORD dwEffect = DROPEFFECT_LINK | DROPEFFECT_MOVE | DROPEFFECT_COPY; SpDropTarget- & gt; Dragentor (pDataObject, MK_LBUTTON, pt, and dwEffect); SpDropTarget- & gt; Drop (pDataObject, MK_LBUTTON, pt, and dwEffect);   

Delphi code will be something like this:

  uses ActiveX, ComObj; Constant CLSID_PrintPhotosDropTarget: TGUID = '{60FD46DE-F830-4894-A628-6FA81BC0190D}'; Project InvokePhotoPrintingWizard; Var effect: LongInt; Status: Tapepoint; DataAbject: IDTababage; DropTage: IDPrint; Start // Photo Printing Wizard drop goal to create OleCheck (CoCreateInstance (CLSID_PrintPhotosDropTarget, zero, CLSCTX_INPROC_SERVER, IDropTarget, DropTarget)); // Drop the data object on the drop object Position.X: = 0; Event. Y: = 0; Impact: = DROPEFFECT_LINK or DROPEFFECT_MOVE or DROPEFFECT_COPY; Olechek (droptrajabrage dragentor (datobbact, mklbutton, position, effect)); Olechek (droptraage.dop (databex, mk_lbutton, position, effect)); End;    

python - Pyflakes with Emacs -


I'm trying to install pyflakes with emacs. So far, I've got FlyMacL file. I put it in my .emacs.d folder. Inside my .emac file, I have this:

  (when loading ("Flymake") (Diffun Flymec-Piplex-Init () (let * (Temp-file -init (file-name-directory buffer-filename)) (local "file-relative-name-temporary-file") (list "pixel-build-temporary-buffer-copy 'flymake-create-temp-inplace) ) "(List-local-file)) (Add-to-list 'flymake-permission-file-name-mask' (" \\. Py \\ '"flymake-pyflakes-init))) (add-hook' 

I have also downloaded piflex And it is callable from command line. However, even when I open my emacs with a file, I still think that this program can not get 'pieflex' why my command line can not emacs pyflakes Can I get it? I am on iOS.

Add / path / to / python / scripts In Emacs exec-path , either init.el or m -

  (Setq exec-path (cons / path / to / python / script exec-path))    

sublimetext2 - FTP using sublime text 2 for Mac -


Is there a way to open a file using Sublime Text 2 for Mac, or what a tutorial describes here How to do?

I was looking for and could not find anything

is a great package Check Out, which adds SFTP and FTP capabilities to the submile. A free trial is available, but it is worth $ 16 license.

javascript - enable postback onclick of a hyperlink in asp.net -


मेरे पास हाइपरलिंक है

  & lt; a href = "" id = "link1 "& gt; क्लिक करें & lt; / a & gt;   

जब भी यह लिंक क्लिक किया जाता है, तब भी मुझे एक पोस्ट वापस कार्रवाई सक्षम करनी है।

हम कर सकते हैं

& lt; a href = "" Id = "link1" onclick = "javascript: location.reload ()" & gt; क्लिक करें & lt; / a & gt;

हालांकि, मैं एक पृष्ठ पोस्टबैक करना चाहता हूं और कोई पृष्ठ पुनः लोड नहीं करना चाहता ।

क्या यह संभव है?

सरल, इसके बजाय उपयोग करें। <पूर्व> शून्य LinkButton_Click (ऑब्जेक्ट प्रेषक, EventArgs ई) {Label1.Text = "यह एक पोस्टबैक है"; Aspx पर

  & lt; asp: linkbutton id = "linkbutton1" text = "मुझे क्लिक करें" OnClick = "linkbutton_lick" runat = "सर्वर "/ & gt;   

आप एक HTML लिंक का उपयोग कर रहे हैं, यदि आप सर्वरसाइड कोड का उपयोग करना चाहते हैं तो मैं सर्वर नियंत्रण का उपयोग करने का सुझाव दूंगा हालांकि, यदि आप पूरी तरह से आग्रह करते हैं कि आप जावास्क्रिप्ट के माध्यम से मैन्युअल रूप से कॉल कर सकते हैं।

  & lt; id = "linkId" href = "javascript: शून्य (0);" Onclick = "__ doPostBack ('linkId', '');" & gt; मुझे क्लिक करें & lt; / a & gt;    

Getting variable type in Autohotkey -


Why does it work to determine

  if the delay is integer {MsgBox you set delay =% delay% second return} and {Msbiboks "% delay%" is not a valid number GoSub, input}   

but it's not - it also allows non-integer values, when even more than 0

  (if delay is integer and delay & Gt; 0) {MsgBox set delay =% delay% seconds back} of {MsgBox "% delay%" valid number no Is to help GoSub, input}   

means the script both snippets to check the result of an input box to remove the film or STH.

  Delay: = 120 Help =   

Help - Open Auto Auto Extractor `nF1: Help`nF2: Get Open Window`n (being in the foreground must) `Nf3: shell set the delay (seconds, normally 120)` NF4: start or stop unpacking`nF5: Exit MsgBox% Help% F 1 :: MsgBox% Help% gain F2 :: WinGetTitle, title, a MsgBox selected window "% Title%" Back F3 :: Input: InputBox, Delay, Set Extraction End In Seconds .., Use Number Only ,,,,,%,%% delay; InputBox, OutputVar [, title, quick, hide, width, height, first, second, fonts, timed, default] if the delay integer {MsgBox set delay return =% delay% seconds} else {MsgBox "% delay % "is not a valid number Gosub, input} #MaxThreadsPerHotkey 3 F4 :: #MaxThreadsPerHotkey 1 if KeepWinZRunning {KeepWinZRunning: = 0 return} else {KeepWinZRunning: = 1} {loop loop% delay% {sleep 1000 if KeepWinZRunning broke { }} if KeepWinZRunning not {break} ControlSend ,, enter {% title%}} KeepWinZRunning: = 0 return F5 :: ExitApp return

I think this question will answer your question from the autohotkey documentation:

Note: operators are "between", "is", "in" And "included" are not supported

Regardless of this rule for me The second example works fine.

mysql - Why am I getting "#1066 - Not unique table/alias"? -


itemprop = "text">

I'm coming in time:

# 1066 - No unique table / aka: ' USER_ACCOUNT '

For the following, I have read all the answers and I believe that it should be fine. What's the problem?

  select user_session.node_id, the user_session include user_account.login_name, USER_ACCOUNT left Where are user_account.id = on USER_ACCOUNT user_session.user_id user_account.login_name = "mike@rocketmail.com" or user_account .login_name = "mikeg@looxcicon.com"    

If you want to know the the USER_ACCOUNT table twice this should work:

  select user_session.node_id, user_session include user_account.login_name left are USER_ACCOUNT on user_account.id = user_session.user_id where user_account .login_name = "mike@rocketmail.com" or USER_ACCOUNT. LOGIN_NAME = "mikeg@looxcicon.com"   

Was your query:

  Join the user_session, left USER_ACCOUNT USER_ACCOUNT   

You can ask the same table several times, but you will need to add a nickname. I do not think that your intention was however

Btw - Since the where USER_ACCOUNT criteria on the table, any need of join the left . Instead, I will replace it with INNER JOIN .

java - Is there a way to execute EJBs outside an app server? -


EJB is like fish that can not live outside the ocean of features provided by the application server.

But at certain times, I do not need all the features of the app server: only one thing is required which is an EJB container and nothing else.

Because it is an ocean (jeabos, webspace) or a lake (glassfish) when all my fish are needed then there is a small bowl of water (EJB container).

In short, can EJB be run exclusively using Java EE? Maybe a virtual / local container?

Take JX-WS: It provides an enduring class that you can publish at any time without any apalaration server. It imitates the hurdle for learning a lot: You can drive anything right without the need to setup or download additional jars.

is a small, relevant EJB container that can fit the bill for what you are searching for. Are there.

android - Java not running with Eclipse, editing eclipse.ini gives error -


I recently installed the latest version of Android SDK, which includes eclipse, when I try to run Eclipse, I first The error came with

A Java Runtime Environment or Java Development Kit should be available ...

As many other users have found me Realized that I have installed Java in the wrong way, and fixed this problem. The error message no longer appears, however, now I am getting the message:

Failed to load the JNI Shared Library "C: \ Program Files (x86) \ Java \ jdk1.7.0 _17 \ bin \ .. \ jre \ bin \ client \ jvm.dll

I saw this issue and found that to include a VM logic to many people, eclipse.ini I get a suggestion to edit the file. I have tried this, but I can not save the file. I try to get an error message in which entry is denied.

I am running Windows 8. Both Eclipse and Java are 64-bit I are the only administrator on the computer If you can give me an idea to fix my problem, then I really appreciate it.

Do not insert the eclipse in the" Program Files "folder. By default, eclipse a The Ishtapan wants to write in the sub-directories, which does not work at that location. File.

Why does var act like cov in R? -


Sorry to ask ... this is definitely a common question, and this is a silly question, but It is annoying me to assume that I want to get the variance of each numerical column in a data frame, like

  df < - data.frame (x = 1: 5, y = seq (1,50,10)))   

Naturally, I'll try

 < Code> var (df)   

Instead of giving me what I hope, what will happen like this

  xy 2.5 250   

I get it

  xyx 2.5 25 y 25.0 250   

which are variations in diagonals, and other places have correlation . Which makes sense when I look at the search (var) and read "var is another interface for the COV", the difference is a convertible and the flow of between yourself, of course. Output is a bit misleading, but I can read with diagonals, or can only generate variants using diag (var (df)) , sapply (df, var) , or repeatedly on lapply (df, var) , or var and df $ x and df $ y Code>.

But why? Variance is a regular, basic descriptive figure, which means only second. Should not it be completely and completely trivial to implement in the data frame column? When I was asked only for difference, why should I sympathize? just curious. Thanks for any comments on this.

idiomatic approach

  Sapply (df, var)   

var has a method for data.frames with data.frame By supporting a matrix .

variation is a regular basic descriptive figure, so correlation and correlation are they are all interconnected and interesting, especially if you use a linear model Want to

You want you to always be able to accomplish your own work

  Var & lt; - Function (x, ...) {if (is.data.frame (x)) {Return (sapply (x, var, ...) else {Return (var (x, ...))}}    

c# - Unable to parse CloudStorageAccount -


मेरा कोड:

  CloudStorageAccount.TryParse ("DefaultEndpointsProtocol = http; खातानाम = your_storage_account_name; AccountKey = your_storage_account_key ");   

हमेशा झूठी वापसी करता है मैं केवल कनेक्टिंग स्ट्रिंग "UseDevelopmentStorage = true" के लिए यह काम कर रहा हूं परीक्षण प्रयोजनों के लिए मुझे इसे दूसरे (डमी) कनेक्शन स्ट्रिंग के साथ चलाने की आवश्यकता है, लेकिन मैं इसे पार्स करने में सक्षम नहीं हूं। कृपया सलाह दें।

अपवाद फेंक दिया गया है "खाता जानकारी का कोई मान्य संयोजन नहीं है"

< P> आपको एक वैध आकार और प्रारूप के साथ खाता कुंजी का उपयोग करना होगा। इसका उपयोग करने का प्रयास करें: kiRN0h4jm24fyLZIT7y5 + iA8nLE + 5QUPisiFNJ / 9bH4ws6T / m9sHmr22 / dw0i + 31Dgb / 9JxYjj / V8SHxVPp7IA ==

php - How to design browser independent html pages? -


I'm trying to design a browser browser using the div. Sometimes the design scene is different in different browsers ??

Eric Meyer will help resolve some of the differences between different browsers.

mysql - Getting error in creating procedure -


I have created a process, but when I try to provide an error that does not have any database selected. Here is my procedure

  DELIMITER $ myproced process declared as varchar (10); Type the number int; BEGIN use lookup; Create a temporary table lookup. As Airport (select name separately from lookup.airpot); Choose from number (*) in num (select * with airport name); End; $$   

I have also seen some posts in the stack overflow about the same problem. They were working with my SQL workspace and asked to select the database from the drop down . I'm using mysql query browser. Even I mentioned the use of the database. But still it is pointing to the error.

Use No need for statement inside the USE process. DELIMITER $$ USE [Name of the database] $$ DELIMITER $$ declaration process declared as my declaration varchar (10); Type the number int; BEGIN Create a temporary table lookup. As Airport (select name separately from lookup.airpot); Choose from number (*) in num (select * with airport name); End; $$

parsing - Parse valid html (php - tidy) -


I want to use a clean plugin but only for one string The code I am using is:

  tidy_repair_string ($ string);   

My problem is that this script is in a file, which I have to use once to include it.

But the streamlined duplicate HTML, body, title tag (normal

example: if my string and gt;

; & lt; / b & gt; Only me & lt; b & gt; & lt; s & gt; Text & lt; / s & gt; & lt; / b &

No:

  & lt ;! DOCTYPE html public "- // W3C // DTD HTML 3.2 / EN ">  gt; Top & gt; Title & gt; & lt; / title & gt; & lt; / head & gt; & gt; Body & gt; & lt; Lt; p & gt; & lt; c & gt; Text       

Thank you!

Maybe it works If not, look for more options

  $ string = tidy_repair_string ($ string, array ('output-html' = & gt; wrong, 'doctype' = & gt; wrong ));    

jquery - Trouble combining checkboxes with this find function -


I'm having this find function having trouble working with the checkbox Was also not able to select the checkbox and was therefore asked to remove the statement return; I'm not sure whether that is the reason or not, but the statement if (attrcolor == 'all') {...} is no longer working.

How can I modify this function so it will work with the checkbox, in which all have to show, if it is selected?

I have posted a bella with a simple example of the function:

  $ (document) .ready (function () {var selected = []; $ ( '# Attributes - $ (this); if ($ this.parent ()) ifClass ("active") $ $ This.parent (). RemoveClass ("active"); selected splice (selected.indexOf (atrolar) 1);} and {$ this.parent (). AddClass ("active"); Selected push (atrrolor);} if (atrolar == 'all') {$ ('#'). ('*') Find (show);} and {$ ("#content"). ") (), ($ ['Data-color * =' '+ item +'"] '). (Show,);}); } // It was removed to allow checkboxes to accept input / return incorrectly; }); });    

Target only checkboxes, and not all elements like Asterix selector, and checkboxes Use "change" event for.

Then get all the Li elements in the variable lis , and hide them all at the same time.

> Check all checked checkboxes $ Map . Mark an array with

isAll , to see that the "all" value is the array that checkbox is checked, if it is, Or if any check boxes are not checked, then the length is zero, show all li , otherwise the colors will be redundant with the code $. Every , and look for any of the matching colors.

  $ (document) .ready (function () {$ ('# attributes-color input [type = "checkbox"]') .on ('change', function () {var Lis = $ ('# content li'). Hide (), check = $ .map ($ ('# attributes-color input [type = "checkbox"]'), function (L, I) {if (el. Checked) $ (el) .data ('c olor');}), isAll = $ .inArray ('all', check)! = -1; If (check.length & isAll) {$ .each (Check, function (i, color) {lis.filter (function () {return $ (this). Data ('color'). IndexOf (color)! = -1}). Show ();});} Else {lis.show ();}});});   



vb.net - Callback For Tasks -


I created a task using the following code

 for  (// pls Variables) Deam Task = (New System Threading. Tasks.TaskFactory ()). StartNew (sub) Download files (end) sub    

The job has been made to N and it works asynchronously, now I do not know how to add callback method for it. is. Can anyone ask me to add a callback for this?

Callback should be used to look like this: I ... left out for each. Personal sub StartTask_Click (The sender as the object, and the form of routing invitation) StartTask handles. Click the slow long task as the task = (New system. Threading.Task.Tokfater). StartAnu (Addressoff DoverSync) Longtask Continewith (Insert Work on Work) debug Print ("") and all '' '& lieutenant; Summary & gt; Called '' '' 'Called after DoWorkAsync Work Completion' / Summary & gt; '' '& Lt; Comment & gt; & Lt; / Comments & gt; Private sub work complete () debug Print ("full") end sub '' '& lt; Summary & gt; '' 'Task' '' written by & lt; / Summary & gt; '' '& Lt; Comment & gt; & Lt; / Comments & gt; Debug for I = 0 to 2000. Print ("Test") Next sub sub

php - Refreshing Dynamic Images Using jQuery -


I am trying to create a list of twitch.tv streams that pulls online / offline status every 60 seconds and An image gives the Php code based on that response I am using this information to draw and return the image below:

    

This part works well I'm calling this code (image.php) as such:

     

And all this works, but it is not alive. I have tried many things so that it can be refreshed and arranged on jQuery. I think what I need to do is add some header information that does not allow the browser to cache the image and maybe keep it in the div that every 60 seconds in jQuery is refreshed, but this is where I Brick walls have been hit. Any suggestion in this regard how can it be done? I'm relatively new to jQuery and here a bit dislikes around, so any help would be greatly appreciated.

To avoid cached images, I have included several possible solutions, such as the date or time of the URL, but since it is already a dynamic image URL, I am not sure how to do that work. / P>

Thanks in advance for any help.

OK, so it may be strange to answer your own question, though I Basically the problem presented is an partial solution:

I used to think of using jquery to automatically refresh a div with this kind of nausea The situation is as follows:

First of all, jquery in my doctor's header is called:

    

Then, under the body section of the file:

    

And finally, around the code with the image in it:

  & lt; Div id = "twitchStatus" & gt; Nameofstreamgoes is & lt; Img style = "margin-down: 0 pixels;" Alt = "" src = "image.php? Stream = namefast smack" /> & Lt; / Div & gt;   

So my current problem is? It works perfectly in Chrome, but not IE or Firefox ... does anyone take anyone? I thought this page might be caching - because it does not look quite fresh, so at the end of the body is the first part of the script, but he did nothing, any help would be greatly appreciated.

.net - Find the generic type -


Is there a way to get it during reflection?
id works & lt ;, & gt; iDictionary & lt; Int, int & gt; , for example?

My intention is this:

  from typeof (uniqueKeyQuery & lt ;, & gt;) Query.GetType ())   

While the ' query ' type UniqueKeyQuery & lt; Sometype, int & gt; .
I want to compare names, because I would like to be Extensible Extensible.

You can try

  typeof (UniqueKeyQuery & lt; , & Gt;). IsAssignableFrom (query.GetType (). GetGenericDefitition ()) If this does not work, you can use it (a static extension method that should be in a fixed class)  
  Public Stable Boole ISO InheritsGeneric Definition (Type Type, Type Generic Definition, Parameter Typed with Out Type Definition) {DefinitionWithTypedParameters = ThisType; Whereas (with parameter plus parameter! = Null) {if (with the definition of the parameter .isgenic type) {if (with the definition of parameter .getgenic type definition == generic definition) return true; } Along with definitions, the published parameters = along with the definition. Parameter. Base type; } return false; }   

Call:

  Type query type; Query.GetType () IsOrInheritsGenericDefinition (typeof (uniquequaequery & lt ;, & gt;), QueryType out);    

Same body function works for different types of input c# -


मेरे पास ऐसा फ़ंक्शन है:

  myFunc शून्य (स्ट्रिंग पथ) {विशेष ऑब्जेक्ट विशेष 1 = नया स्पेशलऑब्जेक्ट (पथ); }   

अब, मेरे विशेष ऑब्जेक्ट में उनके कन्स्ट्रक्टर के कई ओवरलोड हैं, जैसे कि यह इनपुट के रूप में एक स्ट्रीम भी ले सकता है। कैसे किसी अन्य फ़ंक्शन की आवश्यकता से बच सकते हैं जैसे:

  myFunc शून्य (स्ट्रीम स्ट्रीम) {स्पेशल ऑब्जेक्ट विशेष 1 = नया स्पेशल ऑब्जेक्ट (स्ट्रीम); }   

संपादित करें: अतः यह बात है, मैं एक फ़ाइल प्रोसेसिंग रूटिन कर रहा हूं, केवल फंक्शन 1 वास्तव में स्ट्रीम ऑब्जेक्ट का उपयोग करता है, मैं फ़ाइल को मुख्य फ़ंक्शन के दौरान लॉक करना चाहता हूं, इसलिए मैंने सोचा था कि अगर एक फ़ाइल खोलें, जो इसे खुली रखती है, वह काम करेगी, क्योंकि मैं इस फ़ाइल के साथ हस्तक्षेप करना चाहता हूं:

  मुख्य फ़ंक्शन (स्ट्रिंग इनपुटफ़ाइल) {स्ट्रीम स्ट्रीम = नया फ़ाइल स्ट्रीम (इनपुटफ़ाइल, फ़्लेममैड ।खुला); Function1 (); Function2 (); Function3 (); Function4 (); stream.Close (); }   

अब फ़ंक्शन 1 () कुछ ऐसा है:

  फ़ंक्शन 1 () {पीडीएफ प्रोसेसर प्रोसेसर = नया पीडीएफ प्रोसेसर (); प्रोसेसर। AddDataSrc (नया पीडीएफडाटा स्रोत (STRING या स्ट्रीम)); processor.Work (); }   

मैं बस स्ट्रीम का इस्तेमाल कर सकता हूं .. लेकिन मूल रूप से मैं स्ट्रिंग टाइप का इस्तेमाल करता था .. और अब मैं दोनों रखना चाहता था।

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

को myFunc अंदर विशेषऑब्जेक्ट रखें। यदि यह सभी के बारे में परवाह करता है, तो यह विशेष ऑब्जेक्ट है, इसे इसके सदस्य फ़ंक्शन बनाते हैं।

यदि यह संभव नहीं है, तो myFunc ले विशेष ऑब्जेक्ट अपने तर्क के रूप में, इस तरह आपको इसे बनाने के बारे में चिंता करने की आवश्यकता नहीं है।

Regex expression to validate for dollar amount -


I am trying to validate dollar amount, I need help in regular expressions

Something more than equal to 0.1 For example,

Send parameter in php to trigger page refresh 1x -


I'm trying to create an app that triggers different content on a webpage based on a button pressed in the app. I need to be able to send a parameter so that the server needs to refresh the video, image, and text when a button is pressed in the app .... Now this video / image changes but you have a refresh button In the browser to see new content ...

I tried refreshing at one interval and it repeatedly reloads the video / content ...

current I have 3 entries in a mysql In DB, and one field is "active" when I press a button in the app, it sets the "Active" field of all the row in 0, then it sets the record with Active ID = 1 with the ID of the button

In my display.php page, I have to check mysql for all records with active = 1, and it works very well, but I need to refresh it in any way When changes in active records occur The webpage will run only one 1 machine which is running chrome, it appears on a digital billboard, and I want people to trigger different content by pressing different buttons. On my mobile devices ... I can not understand how to communicate with CDA presenter software so that it can be asked to refresh the page so that only webpage updates can be made (J. Areas with the Ajax, but for video / image) and Sedna only looks like a scene in MVC pattern to the web page.

Will there be an iframe help?

So basically you want to find a new PHP script on the server that changes the fields in my MYLL table (On one side there is a way which is a better way to double check again, though I do not remember). After this, put your Javascript Function Pole on this script. Using this method again:

  window.setInterval (function () {/// call your function here}, 100);   

The php script is returned 0 or 1 to activate. Check this result in your java script if the active has changed then reload the page with the request for display.php script ... if you want some help with the code then i can post a bit I'm just ... lunch and dinner on a mobile will take a while.

c# - BackgroundWorker with MySql not working properly -


I have a way that mysql is for the loop in the database .

The amount of inclusion can be very high, so my program is freezing while inserting.

That's why I call it BackgroundWorker , although it is not working in schematic form ...

After getting some insert, I get an exception That my connection has already been opened

How do I do this here:

  if (dbPos.conn open ()) {// contains a line , Then works fine because the data is present in DB DBipes. Checkout (Pries, Y); // It works for some inserts, // but after a couple it will tell me that my cone is already an open worker. RunWorkerAsync (); // Insert multiple rows} dbPos.connClose ();   

My Backgroundworker method:

  zero worker _dovor (object sender, doWorkEventArgs e) {for (int i = 0; I & lt; chartList.Count; i ++) {switch (this.countChart (i)) {... work ... // insert rows}}}   

and My method is to actually enter values ​​in the database:

 using  (MySqlCommand cmd = new MySqlCommand (query, conn)) ... ... parameter .... cmd.ExecuteNonQuery (); }   

So how can I solve this mysterious problem?

The problem is that you are closing your connection:

  If (dbPos.conn open ()) {// contains a row, works fine because the data db dbPos.checkOut (prijs, wie); // This * start * works, but does not block the worker. RunWorkerAsync (); // inserts multiple rows} // This is when the background work is still happening dbPos.connClose ();   

You should call dbPos.connOpen () and connClose () in BackgroundWorker S DuvorX handler allows connections to remain open when this is done.

android - make jsoup get the full HTML content like I can see in my browser -


I am developing the Android app with the web crawling function. I use Jesup to parse HTML content.

I have a big problem because HTML-content (table content of the page) that I need is made by Javascript is not a way to support JSOP Javascript? Or get at least the full HTML-content that I can see in my browser.

I have already tried HtmlUnit, but it does not perform well.

Someone has suggested phatomaj, but I do not know how to use it in Android.

Please help me

Does Javascript support javascript Is there no way?

Unfortunately, you have to use another library to execute the script. Please see my answer for some examples.

asp.net - Combining 'AND , 'OR' in Select statement -


Student name: When the user enters the ID or name and clicks on the button, the details should be defective. ... how?

Do not work here in my selection or section: PublicValue StudentView: System.Web.UI.Page {SqlConnection Thief = New SqlConnection ( WebConfigurationManager.ConnectionStrings ["DBCS"] ConnectionString). Protected Zero Button1_Click (Object Sender, EventArgs e) {String str = "Select Register.UsrFLname, Registration.UsrAddress, Students.STUID, Materials.BookID, Materials.BookName, Courses.CourseName, Courses.CourseFee Course on the inner course Include content. BookID = Materials.BookID join interiors at Courses.STUID = Students.STUID and Materials.STUID = Students.STUID Intermediate Students.STUID = Registration.STUID and Registration.UsrFLname = '' + TextBox1.Text + ' 'Join the enrollment student or student STUID =' "+ Text box 1. Text "" "; con.Open (); SqlCommand CMD = New SqlCommand (str, con); SqlDataAdapter da = New SqlDataAdapter (cmd); Dataset DS = New Dataset (D); Fill (DS, ARR); GDStudents DataSource = DS; GDStudents.DataBind ();

Anyone can help on this issue !!

Thanks in advance!

and have priority over or .

In the boolean argument AND > you should use the parentheses () .

or Ie

  2 * 3 + 1 = 7 2 * (3 + 1) = 8   

I think in your case, status

  Students.STUID = Registration STUID and note (- note that this bracket Registration.UsrFLname = '' + TextBox1.Text + '' or Students.STUID = '' + TextBox1.Text + '' ") - Note this pan   

The number of people who have noted, you should parameter your questions, and end the text given by the end user. Should not be compacted.

objective c - iOS: Align UIImageView to top -


I've got a visual controller, I'm using to load an image from the web. The image is usually going to be much more than the viewport, so I'm scaling it and putting it in UIImageView. The problem does not want to align at the top of the viewport. Here's the code I'll fix it:

  - (zero) viewDidoad {NSLD * imageURL = [NSD URL Youth Ringtones: [[Self-Exhibit] Image]]; NSDTA * ImageData = [NSDTATA DATAVITY content of the: imageURL]; UIImage * image = [UIImage imageWithData: imageData]; UIImageView * iv = [[UIImageView alloc] initWithImage: Image]; [Iv set content mode: UIViewContentModeScaleAspectFit]; [Iv set transclusionsautorerisingmask intactstationes: no]; [[See itself] Adsview: iv]; [Self-Setting View: iv]; NSDictionary * nameMap = @ {@ "imageView": [auto image view]}; NSArray * Horizontal Concept = [NSLayoutConstraint constraintsWithVisualFormat: @ "H: | -10- [imageView] -10- |" Options: NSLayoutFormatAlignAllCenterX Metrics: Zero View: nameMap]; [[View Yourself] AddConstraints: Horizontal Consultants]; NSArray * verticalConstraints = [NSLayoutConstraint constraintsWithVisualFormat: @ "V: | -0- [imageView]" option: NSLayoutFormatAlignAllTop metric: zero view: nameMap]; [[View Yourself] AddConstraints: Vertical Consultants]; NSLog (@ "% @", NSStringFromCGRect ([[auto image view] frame))); }   

Finally the log shows that UIImageView is not the size of the original image size smaller version. I'm assuming that this is a problem, but I'm not sure how to fix it.

I did another solution: I modified this solution to work for me: / P>

The screenwid is less than 600px, so I only need to modify the image. I also know that the aspect ratio of the images I am using is already known.

This is my new view DeDeload

  - (zero) viewDidoad {NSDL * imageURL = [ns URL URLWithString: [[self-exhibition] image]]; NSDTA * ImageData = [NSDTATA DATAVITY content of the: imageURL]; UIImage * image = [UIImage imageWithData: imageData]; If ([[USScreen main screen] bound]. Size width = 600) {CGSize newSize = CGSizeMake (300.0, 140.6); UIGraphicsBeginImageContext (newSize); [Image DrawRight: CGRactack (0.0, 0.0, New Size. Width, New Size.)]; Image = UIGraphicsGetImageFromCurrentImageContext (); } NSLog (@ "% @", NSStringFromCGSize ([Image Size])); CGRTF frame = CGRactMake (0.0, 0.0, imageize.width, imaginesheight); UIImageView * iv = [[UIImageView alloc] initWithFrame: frame]; [Iv set image: image]; [Iv set content mode: UIViewContentModeScaleAspectFit]; [Iv set transclusionsautorerisingmask intactstationes: no]; [Iv setbackgram color: [UIColor redColor]]; [[See itself] Adsview: iv]; [Self-Setting View: iv]; [[Self image view] Setframe: CGRactam (0.0, 0.0, 300.0, 140.6)]; NSDictionary * nameMap = @ {@ "imageView": [auto image view]}; NSArray * Horizontal Concept = [NSLayoutConstraint constraintsWithVisualFormat: @ "H: | -10- [imageView] -10- |" Options: NSLayoutFormatAlignAllCenterX Metrics: Zero View: nameMap]; [[View Yourself] AddConstraints: Horizontal Consultants]; NSArray * verticalConstraints = [NSLayoutConstraint constraintsWithVisualFormat: @ "V: | -0- [imageView]" option: NSLayoutFormatAlignAllTop metric: zero view: nameMap]; [[View Yourself] AddConstraints: Vertical Consultants]; }    

celery - Django is this chaining tasks? -


I have a celery that makes messages similar to a database:

  Class ProcessRequests: Def run (self, batch): q: msg = message for e. Object. Create (Recipient_Number = E. Mobile, Content = Batch Content, Sender = e.contact_owner, billee = Batch.Uz, Sender_Name = Batch.sender_name) Gateway = Gateway.Obiges The gate (pk = 2) msg.send (gateway)   

then the msg.send (gateway) model is another task that actually sends the message and it Runs: SendMessage (function): name = "send sms" max_retries = 10 default_retry_delay = 3 def run (auto, message_id, gateway_id = none, ** kwargs): logging. Debug ("to send a message.") Then logging some stuff here Debug ("Send Message.")

All this works fine (more than 1000 messages were tested), but I have read somewhere that you do not have to work together the chain Nevertheless, it is not Chenning, okay ?

Is this example okay in terms of performance?

Send something like this:

  Send Diff (self, message): "" "Use this gateway to send a message, if` `DJsiri`` If we have installed, then we believe that they have set up `` cellarard` 'server, and we do not queue for delivery. Otherwise, we will send in-process .. Note: It is too much to run out of this process Recommended, especially if you are sending it as a part of HTTP and ITeS, Since it can take up to 5 seconds per message, it has to be sent. "" If settings 'DjCelli' .INSTALLED_APPS: import sms.tasks sms.tasks.SendMessage.delay (message.pk, self.pk) Other: self._send ( Message)    

short version, yes, you are doing the right thing.

Long version:

The thing is that you do not want to do anything like this:

  @task def something (** Kwargs): # do Some things here are some_elles E.delay (). Get () @ Task Def Som_Alse (** kwargs): # Here's something else   

will wait for some results from some_else .

You may also consider creating a message for a task (so your loop only produces work and does not connect directly to the database).

PS: If you want to track all results from the results of ProcessRequests work, then you can execute them as sub-quantities:

This can help you get results group:

Is routes in ruby on rails part of controllers for MVC? -


Quick questions about Ruby's MVC architecture I'm going through Heart's tutorial and whenever I'm new If the static page is added, then it will be located in the config folder. The RB file has to be updated. Is the route of controllers of MOC architecture Is RB part? And if yes, then why is not it in the controller folder? Thanks!

In principle theory differs completely from MVC pattern. The route file is specially to route your controllers to some controllers.

You can think of route files as a psuedo-controller, which handles HTTP requests, and which controller uses for that request.

Manually stepping through CSS animation with JavaScript -


अगर मेरे पास ऐसा सीएसएस कीफ्रेम एनीमेशन है

  @केफ्रेम फ़्लैश-लाल {50% {पृष्ठभूमि: # एफ 00; }} # Goflash.anm-flash {एनीमेशन-नाम: फ्लैश-लाल; एनिमेशन-अवधि: .5 एस; पृष्ठभूमि: आरजीबीए (255, 0, 0, 0); }   

तब मैं हमेशा एनीमेशन को इस तरह से ट्रिगर कर सकता हूं:

  var gf = document.query सिलेक्टर ("# goflash"); gf.classList.remove ( "एएनएम-फ्लैश"); SetTimeout (फ़ंक्शन () {gf.classList.add ("anm-flash");}, 50);   

क्या जावास्क्रिप्ट पर निर्भर होने के लिए एनीमेशन-अवधि / एनीमेशन-टाइमिंग फ़ंक्शन ओवरराइड करने का कोई तरीका है? मुझे gf लाल की पृष्ठभूमि बनाने के लिए gf.animate ("flash-red", "50%") जैसे कुछ कहने में सक्षम होना चाहते हैं, या < कोड> जीएफ। एनिमेट ("फ्लैश-लाल", "75%") पृष्ठभूमि को अधिक rgba (255, 0, 0, .5) की तरह बनाने के लिए

आदर्श रूप से, एक ही तकनीक संक्रमण के लिए काम करेगी। gf.transitionTo ("नया-वर्ग", "50%") तत्व को आधे रास्ते के रूप में संक्रमित दिखाएगा।

जाहिर है फ्लैश-लाल सिर्फ एक उदाहरण है। मैं किसी भी एनीमेशन के साथ ऐसा करने में सक्षम होना चाहता हूँ। < P>

अंतर्निहित एनीमेशन के साथ:

दुर्भाग्य से, नहीं

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

आप फिर भी अपना बदलाव कर सकते हैं इसमें गणना बदलावों को शामिल करना शामिल है।

यह जितना जटिल नहीं है उतना जटिल लगता है जैसा कि आप बस एटम के लिए एक प्रक्षेपण फार्मूला का उपयोग करते हैं:

  current = source + (गंतव्य - स्रोत) * अंश;   

उदाहरण के लिए, रंग के लिए आप इसे रंग घटक के साथ उपयोग कर सकते हैं। मान लेते हैं कि हमारे पास रंग ऑब्जेक्ट्स r , g , b :

  var रंग 1 = {r : 100, जी: 200, बी: 55}; // कुछ यादृच्छिक रंग var रंग 2 = {r: 0, g: 100, b: 100}; Var अंश = 0.5; // 0-1   

यहां वर्तमान आरजीबी होगा:

  r = color1.r + (color2.r - color1.r) * अंश ; जी = color1.g + (color2.g - color1.g) * अंश; बी = रंग 1.बी + (रंग 2. बी - रंग 1. बी) * अंश;   

पदों के लिए:

  var pos1x = 100; Var pos1y = 100; Var पॉज़ 2x = 500; Var pos2y = 250; Var अंश = 1; // 0-1 पॉज़एक्स = पॉज़ 1 एक्स + (पॉज़ 2 एक्स - पॉस 1 एक्स) * अंश; Posy = pos1y + (pos2y - pos1y) * अंश;   

और आगे भी।

आवरण कार्यों को बनाकर आप आसानी से इनकी गणना कर सकते हैं और उन्हें सचेत करने के लिए उन्हें एक पाश में भी डाल सकते हैं।

उदाहरण रंग 1 और रंग 2 के बीच संक्रमण की स्थापना के लिए कार्य। शैली अर्थात् हो सकता है। backgroundcolor , रंग आदि:

  फ़ंक्शन सेट कलर (तत्व, शैली, रंग 1, रंग 2, अंश) {var r = color1.r + (रंग 2। आर - रंग 1। आर) * अंश; Var g = color1.g + (color2.g - color1.g) * अंश; Var बी = रंग 1। बी + (रंग 2। बी - रंग 1. बी) * अंश; Element.style [शैली] = 'आरजीबी (' + (आर | 0) + ',' + (जी | 0) + ',' + (बी | 0) + ')'; }   

( r | 0 बस दशमलव भाग काट रहा है।)

और स्थिति के लिए , उदाहरण के लिए:

  var pos1 = {x: 0, y: 0}; Var pos2 = {x: 200, y: 0}; फ़ंक्शन setPosition (तत्व, pos1, pos2, fraction) {var x = pos1.x + (pos2.x - pos1.x) * अंश; Var y = pos1.y + (pos2.y - pos1.y) * अंश; Element.style.left = x + 'px'; Element.style.top = y + 'px'; }   

एक साधारण डेमो (स्लाइडर्स देखने के लिए क्रोम या अरोड़ा 23 का उपयोग करें, स्लाइडर एफएफ 23 के अगले संस्करण में आता है।)

< / P>

यहां छवि विवरण दर्ज करें

स्रोत और स्रोत के बीच किसी भी बिंदु पर मैन्युअल रूप से सेट संक्रमण भाग्य, या उन्हें चेतन।

C# Language Specification ver 5.0 and List -


I have started reading C # language specialty that comes with Visual Studio: C: \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ VC # \ Specification \ 1033

In chapter 1.6.7.4 events I found the following:

An event is a member who enables to provide notifications to a class or object, an event is declared as a field, except that an event keyword in the announcement is evening And type should be a representative type.

Within a class, declaring an event member, this event behaves like a representative field type (provided that the event is not inconclusive and the accessories do not declare). The field stores the reference of the representative that represents event handlers which have been added to the event. If no event handles are present, the field is empty.

List & lt; T & gt; class declares a single event member called Chenz, which indicates that a new item has been added. Changed events are taken from the on-switch virtual method, which first checks whether the event is empty (meaning no handler is present). The idea of ​​enhancing an event is very similar to implementing representation by incident, thus there is no special language creation to increase the incidents.

The event handler is connected using the + = operator and the following example has been removed using the operator: list & lt; String & gt; .

  Adds a changed event to use the system; Class test {stable fit change; Fixed zero list changed (object sender, EventArgs e) {changeCount ++; } Fixed Zero Main () {List & lt; String & gt; Name = new list & lt; String & gt; (); Name. Changed + = new event handler (changing list); Names.Add ("Liz"); Names.Add ("Martha"); Names.Add ("Beth"); Console.WriteLine (changeCount); // Output "3"}} For advanced scenarios where the underlying storage of an event is controlled, an event announcement can clearly add and remove the addressers, Excerpts set of assets are somewhat similar.   

When I came to know about the list.Changed event, I was surprised, so I created a new console application in Visual Studio 2012 < P> When I tried to compile the application (using both the Visual Studio and Developer Command Prompt) I got the following error:

Error CS1061: 'System.Collections.Generic.List There is no definition for 'change' in and any extension method The first argument of the 'changed' type 'System.Collections.Generic.List' type can not be accepted (are you using an instruction or assembly reference?)

Am I missing something here? I used the ILSP to see the definition of the class and I do not see the changed event.

The class> list displays a normal category, which implements an incremental list of objects.

This is not related to the list code class. collection. GenericList & lt; T & gt; , except that they have the same name.

python - a (presumably basic) web scraping of http://www.ssa.gov/cgi-bin/popularnames.cgi in urllib -


I am very new to Python (and web scrapping). let me ask you a question.

Many websites do not actually report their specific URLs in Firefox or other browsers. For example, popular child names are shown with ranks (since 1880) in the Social Security Administrator, but when I The year changes from 1880 to 1881, then the URL does not change. It is consistent,

Because I do not know the specific URL, I could not download the webpage using urlib.

The source of this page includes:

input type = "text" name = "year" id = "yob" size = "4" value = " 1880 "& gt;

It seems that, if I can control this "year" value (e.g., "1881" or "1991"), I can deal with this problem. Huh? I still do not know how to do it.

Can anyone tell me the solution for this?

If you know some websites that can help in my studies, please let me know.

Thank you!

You can still use urllib . The button does a post to the current URL. Using Firefox I took a look at network traffic and found that they are sending 3 parameters: member , top , and year . You can send the same logic:

  import urllib url = 'http://www.ssa.gov/cgi-bin/popularnames.cgi' post_params = {# member was empty, so I 'Top': '25', 'Year': Year} Post_Arg = urlib.urlencode (post_params)   

Now, just send url-encoded logic:

  urllib.urlopen (url, post_args)   

If you also need to send the header:

  header = {'accept' : 'Text /html,application/xhtml+xml.application/xml;q=0.9,*/*;q=0.8', 'Accept-language': 'N-US, N; Q = 0.5 ',' connection ':' keep-alive ',' host ':' www.ssa.gov ',' referrer ':' http://www.ssa.gov/cgi-bin/popularnames.cgi ' , 'User-agent': 'Mozilla / 5.0 (Windows NT 6.1; WOW64; rv: 21.0) Gecko / 20100101 Firefox / 21.0'} # POST with data: urllib.urlopen (url, post_args, headers)   

execute a code loop: year in the xrange (1880, 2014): # code above ...

Implement a LRU Cache in C++ - compilation error -


I need to implement an LRU cache in C ++. I have this code and I have a problem while compiling :

  #include & lt; Iostream & gt; # Include & lt; Vector & gt; # Include & lt; Hash_map> using namespace std; Using namespace stdext; Template & lt; Class K, Class T & gt; Struct LRUCacheEntry {K key; T data; LRUCacheEntry * prev; LRUCacheEntry * Next; }; Template & lt; Class K, Class T & gt; Class LRUCache {Private: hashmap & lt; K, LRUCacheEntry & lt; K, T & gt; * & Gt; _mapping; Of vector & lt; LRUCacheEntry & lt; K, T & gt; * & Gt; _freeEntries; LRUCacheEntry & LT; Kashmir, T & gt; * Head; LRUCacheEntry & LT; Kashmir, T & gt; * Tails; LRUCacheEntry & LT; Kashmir, T & gt; * Entries; Public: (int i = 0; i & lt; size; i ++) _freeEntries.push_back (entries + i) for LRookacht (size_size) (entries = new LRUCentchentry & lt; K, T & gt; ); Head = new LRUCacheEntry & lt; K, T & gt;; tail = new LRUCacheEntry & lt; K, T & gt; Head- gt; prev = NULL; Head-> Next = Tail; tail-> gt; Next = Faucet; Tail-> Tail-> LRUCache () Removal of Head; Removal of the tail; Delete [] Entries;} Void placed (K key, T data) {L. ruecache entranty & lt; k, t & gt; ; * Node = _mapping [key]; if (node) {// link list al Refresh the c (node); node-> data = data; (node);} and {if (_freeEntries.empty ()) {node = tail-> gt; different (node); _mapping.erase ( Node-> keys); node-> data = data; node-> keys = key; (node);} and {node = _freeEntries.back (); _freeEntries.pop_back (); node - & gt; key = key; node-> data = data; _mapping [key] = node; give it;}}} t mill (k key) {lrukkentry lt; k, t & gt; * Node = _mapping [key]; If (node) {separate (node); (Node); Return node-> Data; } And return null; } Private: Zero breakdown (LRUCacheEntry & lt; K, T & gt; * node) {node- & gt; Prev-> next = node-> next; Node-> Next-> gt = previous = node-> Previous; } Zero Enclosed (LRUCacheEntry & lt; K, T & gt; * node) {node- & gt; Next = head-> next; Node-> Prev = head; Head-> gt; Next = node; Node-> Next-> gt = previous = node; }};   

resualt compile:

  /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../ In the file included. /../../include/c++/4.4.7/backward/hash_map:60, from the source. C: 3: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../include/c++/4.4.7/backward/backward_warning.hjg: Warning: # WARNING: This file contains at least one excluded or outdated header, which can be deleted at any future date without any notice. Instead use a non-exiting interface, instead with equivalent functionality. For a list of replacement headers and interfaces, the back_description. Consult the file. To disable the use of this warning - No-nondescript. Source.C: 6: Error: A stdextà ¢ is not a namespace-name source. C: 6: Error: ¢ A token source before the expected namespace-name. C: 21: Error: The declaration of ISO C ++ is prohibited with hash_map ¢ with no source source. Source: C: 21: Error: Expected ÃÆ'à ¢ â,¬Å¡Ãƒâ € šÃ, · Token Source.C: Member Function Zero LRUCache & lt; K, T & T)  ¢ source: C: 46: Error:  ¢ _mappingà ¢ This field was not declared in the source. C: Member Function ÃÆ'à ¢ â,¬Å¡Ãƒâ € šÃ, LRUCache & lt; Kashmir, T & gt; Source: c. 77: Error: This area was not declared in   

Can anyone tell me how can I fix "stdext" problem? I think this will solve the remaining errors. TNX!

stdext is an MSVC extension, but you are compiling it in GCC With Linux, this is not a GCC extension, but its header is ext / hash_map , and instead of stdext __ gnu_cxx Namespace is in place. Both MSWC and GCC have the same interface as hash_map, but if I miss the right, then there are subtle differences.

If you can, use the C +11 11 unarmed_map, if unsuccessful, you have TR1 available, and is st1 :: tr1 :: unordered_map . As the final fallback, consider Boost's unmadened containers (which works as the basis for the interface of TR1 and C ++ 11).

Edit I see that you are using GCC 4.4. X, TR1 is available there. The only issue would be if you are compiling the same code on windows with MSVC, also, I do not believe TR1 is available (I have VC8 and VC9 available, and are not available in both of them. I believe they directly support C ++ 11 libraries in VC10, start leaving TR1 completely).