Tuesday, 15 July 2014

java - Adding Random numbers into a heap -


According to Eclipse, I do not have permission to add a random number array list directly to my "Comparable" parameter I have no clue how to add them.

  Random Generator = New Random (777); Minhap MH = New Minhap (); For (int i = 0; i  

This is my method to add (in another category)

  add public zeroes (comparative new elements) {// A new address element Add. Add (zero); Int Index = Elements () - 1; // Demonstrate older parents than the new element / this last "comparator" & lt; Maximum Hap and & gt; While for Minhap (index> 1 & amp; amp; and; mount paper (index) .comparareto (newElement) <0) {elements.set (index, getParent (index)); Index = found pattern index (index); } // Set the new element in empty slot elements .set (index, new element);  

} I get this error: java.util.Random can not be entered in java.lang.

Why ??

generator , which is an object instead of random

random value you can use the generator

you The value of the integer can be automatically boxed which try comparative

:

  integer rand = generator. NiextInt (100); Println (rand); Mh.add (rand);  

visual studio 2013 - NuGet: what should go into TFS? -


I am working on a client project; They are hosting TFS server.

I started working on an existing body code, in particular a library which is a member of the solution and is bound to control the TFS version. (Small padlock icons appear on this project.) I added a unit test project to go with it. I believe that when I added the test project, I did not specify "Tie in Versions Control", and therefore manually added the project to TFS. It's all right.

I've added the NuGet package dependency for both library and unit testing. In both cases, the only change in TFS repo was a new packages.config file. When a customer's build server is built, it captures the package with NuGet. Customer is happy with this; Maybe they should not be?

Then I made another application project with my own solution, sharing some projects in the original solution. When I created a new project, I "forced the version control". I've added the same package dependencies, but this time there is a new package folder that contains package DLL, and everyone was added to TFS; There was no packages.config file.

I got a link that was told to me how to "enable package restore", and tried to do it; Now I have a .nuget directory in the solution; A repositories.config has been added to the package ; And in the changes in Share .csproj files, and , I still have package binary for checkin.

I think I will need to start with this new solution, but I want to do the right thing, it is not clear to me that using only one packages.config Managing packages is the right thing I have to discourage the use of package restoration.

I'm working with the Express Edition of VS 2013, if it does make any difference.

You have the nuget.config file, package.config file in the project, repositories.config with the package folder and Changes to the project file should check the .nuget directory.

You should not check binaries in the package folder, they will be downloaded from Nugget during build.


sql - Violation of PRIMARY KEY. Cannot insert dublicate keys in many-with-many relationship -


I am trying to insert the table into several relationships with many:

  announcement @ TransactionTempTable Table (ID int IDENTITY (1,1) nULL pRIMARY KEY, Opreshnnam Anwarchar (100), Chaluekountaidi Int, Rashiman decimal, execution date date time, rates include value wealth) in @TransactionTempTable (Opreshnnam, Wartmanakountaidi, Rashimoni execution Date, quadrature) Select [Operation Name] as OperatioName, A.AccountID CurrentAcc ountID, dbo.Amount as ([AmountMin], [AmountMax]) AmountMoney as, Dates.item ExecutionDate as, 0 RateValue as ExcelDatabase.dbo.Transactions T Cross apply dbo.GenerateDate from (GETDATE ( ) [rate], [period]) as dated interiors Gurskiy_EconomicApp.DBO.Accounts Join one T.Account = A.AccountName announced @minID int = (sELECT MIN (ID) from @TransactionTempTable) announced @maxID integer = (Announced from Max (ID @TransactionTempTable) announcing @lastID integer declaration @SplitCategories table (category name is not nostril (100)) WHILE (@ minID & lt; = @ MaxID) joined Google in Gurskiy_EconomicApp.dbo.Transactions (currently Sisiaidi, `` the amount Muni, execution date, rate value) Select `current Khatakhol, Rashimoni, execution date, rate value @ TransactionTempTable WHERE ID = @minID SET @lastID = select the @SplitCategories in SCOPE_IDENTITY () iNSERT the Gurskiy_EconomicApp.dbo.fnSplit ((sELECT OperationName fROM @TransactionTempTable WHERE ID = @minID), ',') iNSERT Gurskiy_EconomicApp.dbo.TransactionCategory (transactionId, CategoryID) Do @lastID, @SplitCategories as SC Indoor as C.C.CategoryName = C.CategoryName T @minID = @ minID +1 End Gurskiy_EconomicApp.dbo.Categories Join C.CategoryID  

This is my code. I insert the range ID and transaction ID in the transaction category in the table Can not, but the table "Transactions" is filling the right and table categories are also filled. I have just one simple mistake about the display, but in my code I am not getting any fault. Please help plz, this action takes place in my mind at the end of the day. TransactionCategory Table Definition:

  Table TransactionCategory (CategoryID does not make an integer zero, transactionId zero not int, constraint transaction_category_pk primary key (CategoryID, transactionId), barrier FK_Category foreign key (CategoryID) reference section (CategoryID), barrier FK_Transaction foreign key (transactionId) reference transactions (transactionId))  

you try to insert @lastID, C.CategoryID in transactions Category . Is generated from the @lastID identity, so I think it is different in every move, am I right? However, @lastID is stable within a single trip, therefore C.CategoryID should be unique C.CategoryID Categories Comes from the table and I also believe that this is P. If there is a duplicate category identifier in this table. Can you confirm this?

This means that due to being with the Categories to join the duplicate @SplitCategories . In other words, I think there are duplicates in @SplitCategories . To confirm this, you can add the following line before entering and we will see:

 < Code> select * @SplitCategories from  

I think the problem may be in the fnSplit function. Maybe it's wrongly dividing the operation name you OperationName column? fnSplit from

and the source code of the example data could be shown

java - Spring MVC using custom HttpServletRequest -


I have created my own HTC PrestigeText class (I'm overriding it only in 1 method) but I do not know how What is the use of spring?

You can use the private @ etoworth HTTPSworld request request like this;


How do I write png hex values stored in a string to a png file in Ruby? -


I have a head value stored in the string but I want to write it in a new PNG file. I am currently using ruby ​​code below (with a small PGG example), but the hex values ​​are slightly off when I see the output in a new PNG file. ? Where am I going wrong

  png_hex = "89504e470d0a1a0a0000000d494844520000000d0000000d08030000004535144e0000000774494d4507d7041517171c5943ea76000000097048597300000b1100000b11017f645f910000000467414d410000b18f0bfc610500000015504c544500000086c1e01544706ba4da4a85c6386c9f427ab6583bfce90000000174524e530040e6d866000000434944415478da558d41120030040395c8ff9f5cd421dd0b6b02b3e198c24f1d22c72996bed1683c89ae3d2f4856ed6570795b317dec0da45aba04ad2e761cfb7a4228bb5cb30147915c409a0000000049454e44ae426082" File.open ( "temp.png", "w") {| FH | Fh.print png_hex.scan (/. {2} /) Map {| U | U.to_i (16)}. Use the pack ("C *"}}  

to open the file in binary mode For "w" for "wb" :

  "b" binary file mode is pressed EOL & lt ; - & gt; CRLF conversion on Windows and set external encoding to ASCII-8 BIT, unless explicitly specified.  

Anyway, you can create an array and 8-in- To write a bit integer you can call:

  file. Open ("temp.png", "wb") {| fh | Png_hex.scan (/. {2} /) { | E | Fh.putc (e.hex)}}  

enterprise architect - Using Centralized model of EA for my project -


I am using a centralized model with an MSSQL instance installed in the cloud for EA project - different from my developers The location is connected through the network. My developers have an issue that takes 72 seconds for connecting to the centralized model and drawing a sequence diagram. You can support for the following: 1. If the wann adapter will increase performance? 2. What is the distribution of models of EA database? 3. Does EA provide auto synchronization of DB in distributed models ?? 4. How EA-Cloud services are enabled?

The wan adapter will correct it, but only a bit. It is most likely that you are facing some network problems. If you get stuck with it then you should contact Sparks Support via mail. They help users with such a dilemma a lot.

You can switch to distributed EAP files and version controls (if network problem can not be solved). Of course, you loose the ability to work in a synchronous manner and only after getting the latest, you will see the changes from others.

If you use the version control feature, the EA user needs to trigger a synchronization. While one package is examined by one user, it can not be replaced by others, it can be locked, especially if the model cut sub optimal is possible.

Cloud DB is not new. I doubt it will improve performance but can not talk to the experience.


ios - Swift clarification about optional with NSDictionary and valueForKey -


I'm trying to learn swift porting in my obz-c code which manages HTText, but when I In response to JSUN, I have to try to use NSDictionary.

JSON example:

  {response = {id = 1234; Name = a2b3n4h5lkl3; }; }  

I get the HttpRequest full handler

  (dictionary: NSDictionary ?, error: NSERR?) - & gt; From zero  

I want to get some values ​​from NSDictionary? And save them to a var:

  Feedback = Dictionary! .valueForKey ("feedback") as? NSDictionary println (responseDictionary!) // contains the information correctly if (responseDictionary!! Count> 0) {var testStringAccessId: NSString? = ResponseDictionary! .valueForKey ("id")! Like? NSString println (testStringAccessId) / print nil println (responseDictionary! .valueForKey ("id")) // Print the correct string if StressAccessed = ResponseDiskin! .valueForKey ("id")! Like? NSString {self.accessID = stringAccessId} other {println ("error no access id") // complete here (success: wrong) return / exit function with error}}  

I tried many combinations but maybe I'm missing something in alternative use. The strange thing is that if I comment back to the case of error and try to get another value from NSDictionary then it's okay , Such as:

  if string is written = copy Saddiskactor! .valueForKey ("name")! Like? NSString {self.accessname = stringAccessname // I get the correct value saved in the variable} other {println ("error does not enter NAME") completion (success: incorrect) returns}  

Also please help?

Thanks alay

Resolved :

Use NSNumber instead of NSString. Thank you for Jasper

As you have said right in your question after editing, your ID is a String (or NSSTING), which is trying to insert a string in any NSN, it will return the value of zero.

  var testStringAccessId: NSNumber? = ResponseDictionary! .valueForKey ("id")! Like? NSNM  

Here is the right syntax for using.

Maybe I would like to add that you want to open the dictionary before checking it. You want to add a check there, what if you can not connect to the internet, or when your API crashes? There are very few times where you actually ! Using


It method not taking js: true in Rails testing setup with Minitest, Capybara, and PhantomJS -


itemprop = "text">

Hi I am running a Rail 3.2.21 application with the following Gemfile:

  Group: Testing: Development: Mani "minitest-rail-capybara" gem "capybara_minitest_spec" Mani 'factory_girl_rails' Mani 'Bari' Mani 'guard' gem 'guards- minitest' gem 'poltergeist' gem 'phantomjs', required: Is = & gt; 'Phantomjs / poltergeist' end  

And I have a test / minitest_helper.rb file like this:

  ENV ["RAILS_ENV"] = "test" "Expanded_path" ("../../conf / environment", __FILE__) requires "minimum / autoron" file "capibara / rail" # "active_ support / test / setup_and_readdown" is required # Mintest :: Space Category Mintest :: Specine Factory Grid :: Syntax :: Methods include rail. Application Robot. CAPEBARA at URLHollper :: DSL and Class Integration Test and Lt; Mintest :: Space includes rail. Application Route. URL_Holpper includes CapBada :: DSL Register_SPEC type (/ exam $ /, self) and turn.config.format =: outline capira. Registrar drew: poltergeaster do | App | Capybara :: Poltergeist :: Driver.new (application ,: phantomjs => phantomjs.path) end  

Whenever I test out an HTML page is certain that Whether to try a test, some javascript requires the word generated under test / features / order_test.rb

 , to describe the "simple order form" to 'minestest_helper' "The user selects the selected file name after selecting the file", js: true do command-v3_path page.must_have_content Go to the end of the 'drop' end  

complains that "this" method takes only 0..1 arguments

  / user /nik/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/minitest/spec.rb:201:in`This: Wrong number of arguments (for 2 0..1) (ArgumentError) 

Post text "itemprop =" text ">

According to JS, the truth block must be in the description.


jquery - Uncaught ReferenceError: result is not defined...for displayCars(result); -


I have the following snippet of code: Getting an unwanted reference Error: The result is not displayed ... displayCars (Results) for;

The code is:

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function) {displayCars (results); function display () {$ .ajax ({type: 'GET', url: '/modules/crm/selector-ajax.php', data: { 'Action': 'images'}, success: function (result) {var photoDiv = $ ('# boat_isotope_gallery'); var divHtml = ''; var results for $$; from SEANS (result); photoDiv.html (divHtml); }, Error: function (error) {console.log ('Ajax failure');}}})}}); // End of document is ready & lt; / Script & gt;  

I have seen posting about the script call order. My scripts are said in the header document, they are said before the snippet of the following order and above:

  & lt; Script type = "text / javascript" src = "// ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> & Lt; Script type = "text / javascript" src = "// code.jquery.com/ui/1.10.2/jquery-ui.js"></script> & Lt; Script type = "text / javascript" src = "/ scripts / tools.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ script / jquerymenus.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ script / selected .jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ scripts / jquery.cookie.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "https://netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "// cdnjs.cloudflare.com/ajax/libs/jasny-bootstrap/3.1.3/js/jasny-bootstrap.min.js"></script> & Lt; Script type = "text / javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "http://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/2.0.0/isotope.pkgd.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "http://cdnjs.cloudflare.com/ajax/libs/knockout/3.2.0/knockout-min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "/ scripts / selector.js" & gt; & Lt; / Script & gt;  

Why did I get this error?


Java help? '(' '[' expected -


Can someone say that what additional '(' or '[' should be?]

  Private command from pixel {string item = command.Get escondworld (); item new item; room r = the player.gaterem (); new item = rggetim; if (newest == empty) system. Out.println ("that item is not here"); and {inventory.ed (new item); R.Vmwittam (item); system.out.printLN ("selected:" + item);}}  

new bracket is needed:

  Add list (new item ());  < / Pre> 

design patterns - How to not fall into R's 'lazy evaluation trap' -


"R is not near, not value. This promise is not evaluated when it is first evaluated, Is passed. ", See G. See also reference of Headley's book by Greyhandende.

In simple examples like

  & gt; Have fun & lt; - lapply (1:10, function (i) function () print (i)) & gt; Have fun [[1]] () [1] 10 & gt; Have fun [[2]] () [1] 10  

It is possible to keep such unsatisfactory behavior in mind.

However, I often fall in this trap during the daily development. I follow a rather functional programming style, which means that I often have Function A function B, where B. is on the basis of some parameters with whom A was called. Dependence is not as easy as it is in the above example, because calculations are complex and there are many criteria.

Due to this problem it is difficult to debug problems, because all calculations run smoothly - except that the result is false, only a clear validation of results shows the problem.

What comes at the top, even though I've seen such a problem, I'm never sure which variable I need force and which I do not I do

How can I make sure not to fall into this trap? Is there a programming pattern that stops it or at least ensures that I have a problem? P> You are creating functions with false parameters, which is not necessarily the best practice in your example, the contained parameter i will be another way of working again:

  Library (functional) MyPrints & lt; - Function (x) Print (x) Enjoy & lt; - lapply (1:10, function (i) curry micrint, i) fun [[1]] () # [1] 1 fun [[2]] () # [1] 2  

Here, we clearly specify the parameter curry to note the function that we could cream directly the print but for example not here Were.

Creates a new version of the Curry function with pre-defined criteria. This parameter clarifies the specification and avoids the potential issues that are going on in you because curry evaluates the forces (which is not a version but it will not help here).

Another option is to capture the entire environment of the original work, copy it, and assign it to the parent of your new function:

  funs2 & lt; - lapply (1:10, function (i) (funny .lt; - function () print (i) environment (fun). & Lt; - list2env (as.list (environment ()) # Force parent env copy fun .res}) funs2 [[1]] () # [1] 1 fun 2 [[2]] () # [1] 2  

But I do not recommend it because you Maybe a copy of the whole bunch will not be needed, the variables may not be worse, it becomes much more complicated if you have nested the layers of tasks that make up the works. The only advantage is that you can continue your underlying parameter specification, but again, it seems like bad practice to me.


asp.net - Data in C# to JSON -


I have a list of departments and have to show them inside a tree view. I am using C #, ASP.NET, I call this cool control Treed, but this requires a JSON file.

What would be the best way to achieve this type of JSON structure from ASP.net?

Currently I store this data in the form of datatale. If there is any solution through any other collection, then please advise that IM open anything at this point.

Many thanks for your help

First of all, there are some underlying chain carriers. You can use JSON data to use WCF DataContracts and DataContractJsonSerializer for consumption by the end points of your service. If your application uses a lot of WCFs in its service architecture, then it should be easy to include the serializer.

The system. Web Script The Serialization also has a JavaScript Secreaser class; It has a low aspect-oriented optimization plan, which requires you to define a custom converter class, if the serializer can not understand your class (or its default behavior is not what you want), but you have given the output and Consumptions both control this JSON data and you can theoretically customize client-side scripting to deal with default behavior. A. Overall, this object is the simplest way to convert JSON.

Finally, there is a third-party library available at JSON.NET. It's great; I have used it in some projects for JSON results of AJAX-Y script methods. I have features that you can use to optimize tweaks for the actualization behavior, without the full load of WCF DataContracts.


python - How to handle attribute access errors in Jinja2? -


मुझे यह मिल गया है:

  टेम्पलेट = '{{invoice.customer.address .city}} ' 

और यह ठीक काम करता है। लेकिन कभी-कभी इनवॉइस कस्टर्मर नल या इनवॉइस। ग्राहक.एड्रेस नल है और फिर जेन्जा फेंकता है jinja2.exceptions.UndefinedError: 'None' के पास कोई विशेषता 'पता नहीं है' क्योंकि यह उस .city भाग तक नहीं पहुंच सकता। तो मैं इसे कैसे चुपचाप में विफल करने के लिए कहूं, अगर वह एक विशेषता का उपयोग नहीं कर सकता है?

धन्यवाद

यदि आप ऐसा अक्सर कर रहे हैं, प्रति-विशेषता फ़िल्टर बनाने की बजाय आप वार् के उत्तर को मनमानाकृत नेस्टेड शब्दकोशों के लिए काम करने के लिए सामान्यीकृत कर सकते हैं, जैसे:

  import jinja2 def चाबी में कुंजी के लिए keys = path.split ('।'): Try: value = value [key] को छोड़कर keyError: डिफ़ॉल्ट वापसी मान वापसी env = jinja2.Environment () env.filters [filter_nested_dict (मान, डिफ़ॉल्ट, पथ) 'Nested_dict'] = filter_nested_dict टेम्पलेट = env.from_string ('' 'शहर: {{इनवॉइस | नेस्टेड_डिक्ट (' & lt; none & gt; ',' customer.address.city ')}}' '')  

उपरोक्त को देखते हुए, यह:

  प्रिंट template.render (इनवॉइस = {})  

आपको देता है:

< पूर्व> शहर: & lt; none & gt;

और यह:

  प्रिंट template.render (चालान = {'ग्राहक': {'address': {'city': 'boston'} }}  

आपको देता है:

  शहर: बोस्टन  

embedded - How to create sh script with expect? -


I am trying to create a script using the script for embedded system (not to include the firmware I want to change this script) So, I have the following script, which is the wrong use of val in if -black:

  The reason does not work! / Usr / bin / env Expected set timeout 20 set ipaddr [lindex $ argv 0] spawn telnet $ ipaddr is expected "soc1 login:" "root \ n" send "prompt" send "val =` some_command` \ n "" Prompt # "Send" if [\ $] Well-Ace 0]; Then Echo Good; fi \ n "# here ^^^^^" Prompt # Enter "Send" \ n "Interact  

I have tried to use $$ and this does not help. How to fix this script to allow the use of variables in Sh script?

[ and ] - These brackets should be saved:

  send "if \ [\ $ val -q 0 \]; then good resonance; FI \ n" # ^ ^^^^^ here " > 

ruby on rails - How to get fields from the child table in the result set -


I've been joined between two tables. Instruments are the original table and the status child's table. I am looking to recover only those devices which are in inst_status = 'active' child conditions table.

  i = Tools Joins (: statuses) .where ("statuses.inst_status = 'active' ')  

is a query that arises:

  SELECT" instruments ". "From" Instruments "to INNER" Conditions "go to" Conditions "" Device "_" Tools "." Id "WHERE (statuses.inst_status = 'Active')  

Which is OK He is only activating 55 devices that are active, however, how can the fields from the (child) table in the result set with the fields from the (maternal) device table be obtained?

OK, you have to use the method for this:

  Instrument.joins (: statuses) .where ("statuses.inst_status = 'active'") .select ("inst ruments. * , Position. * ")  

rest - A JSONObject text must begin with '{' at character 0 of "} when posting data using C# -


I am trying to multipart a comfort web service using C # from my Windows Phone.

This is the httpclient I'm using for

Even if the string I'm sending is this:. {"AuthenticationRequest": {"Company": "3000", "identificationCode": "111", "Username": "Jack", "Password": "Paz"}}

I am receiving a description of this message in my reaction body:

will start with a JSONObject text 'on' character 0 "on}

Here is my code:

  Task postHttpClient async public (string serviceUrl, string requestObj) {var customer = New HttpClient () try {; client DefaultRequestHeaders.TryAddWithoutValidation ("Content Type", "Multipurpose / Form-Data"); MultipartFormDataContent Content Re = new MultipartFormDataContent (); Debug.WriteLine ("RequestObject:" + requestObject); content.Add (new string content (request obz, encoding. UTF8), "authentication record"); Var response = wait client.PostAsync ( ServiceUrl, content); responseVar.EnsureSuccessStatusCode (); debug.lightline ("ResponseWeek:" + Reaction.Towstring ()); Var Body = Wait for response. Continent Redeststring Async (); Debug Farewell line ("body:" + body); } Hold (exception e) {Debug.WriteLine ("E:" + E. ToString ()); What is wrong with me?   

Note: The first letter of my variable has been received as {

  debug Virline ("first letter:" + request obz [0]);  

I also trimmed that variable with any changes

After the

It may be that the service with the expectation of your service / JSN content and you can use multipart / form - sending the data.

Try it:

  var message = new HTTP and message (HTTP Meth. Post, new URI (service URL)); Message.Content = new StringContent (json, encoding. Utf8, "app / jason"); Var results = eliminate the client. SendAsync (Message, Cancellation Token);  

Sort two set of instances based on one of them - Views - Ruby on Rails -


ROR app contains posts and categories, main line categories / posts have a line set of this category per category (3 days) More new). Empty categories are not shown

I want to sort the index view to show the categories with the most recent posts, so when a new post is created for a category, then the category app's first "Row" goes up within a category, posts should also be ordered from new to large.

So I need to sort the two levels, the categories are categories with categories along with the latest categories and the category of posts according to the category. I'm really stuck, how do you implement it?

My Controller:

  DIF Index = Segment = Category. In White (: Post). Selection {| C | C.posts.where (['created_at & gt ;?', 3.days.ago]). Count & gt; 0} end  

My view:

  & lt;% @ categories.each do | Category | & Gt%; # Category Show & lt;% category.posts.where (['created_at>', ', 3.days.ago]) Do each. Posted in | & Gt%; #Show Post Title and Date & lt;% end% & gt; & Lt;% end% & gt;   

Update: To show what I've tried so far:

I posted the first categories, based on the post Tried to sort 'creation_data (as explained in the category, post is: post). In my controller:

  @segment = category. Include (: post) .dr ('posts.created_at'). {| C | C.posts.where (['created_at & gt ;?', 3.days.ago]). Count & gt; 0}  

Then, in my opinion, organize the loaded posts:

  <% categories.each do | Category | & Gt%; # Category display name & lt;% category.posts.order ('created_at'). Where (['created_at & gt ;?', 3.days.ago]). Every do Post | & Gt%; #Show Post Title and Date & lt;% end% & gt; & Lt;% end% & gt;  

with respect to counter_cache sugestion; I understand that this database will be for the optimization of the call, although not strictly necessary.

Solution : As stated in the previous update; But with the change of command ('posts.created_at') per command ('posts.created_at DESC') in the controller; And changes of order ('created_at') copy command ('created DASC') in the view.

Can you try the following? (Sorry for gets , but it will be faster)

  class Jens (: post). Selection ('Categories. *'). Groups ('Categories ID'). Where ('posts.created_at & gt ;?', 30.days.ago). Howing ('COUNT (पद. *) & Gt;) .डर (' posts.created_at DESC ').  

java - How to wait until an element no longer exists in Selenium -


I am testing a UI in which the user clicks the delete button and a table entry disappears like, I want to be able to check that table entry no longer exists.

I've tried Expected Conditions.not () to convert ExpectedConditions.presenceOfElementLocated () , hopefully it will mean "hopefully That there is no specific element "My code is:

  Browser. Navigate (). ("Http://stackoverflow.com"); New WebDriverWait (Browser, 1). Unless (required conditions. (Expected conditions. Presentations published (By.id ("foo"))); However, I found out that due to this, I am saying because of the  timeout xpcation  a  noSuchElementException  element that is "foo "Does not exist. Of course, there is no such element that I want, but I do not want any exception to throw me. 

How can I wait until an element exists? I like an example which does not rely on catching an exception if all possible (as I think, exceptions should be thrown for extraordinary behavior).

You can also use -

  New WebDriverWait (driver) , 10). Unless (ExpectedConditions.invisibilityOfElementLocated (locator));  

If you go through its source then you can see that both NoSuchElementException and staleElementReferenceException are handled.

  / ** * There is an expectation to see if an element is either invisible or not * exists at the DOM * * @ Param Locator used Element * / Public Fixed Candidate Conditions & lt ; Boolean & gt; InvisibilityOfElementLocated (final by locator) {New casual withdrawal return & lieutenant; Boolean & gt; () {@ Override Public Boolean Apply (WebDrive Driver) {try {return! (FindElement (locator, driver) .isDisplayed ()); } Hold (KnowledgeApplement E) {// Return is true because the element is not present in the DOM // Check block block if the element exists but is invisible. Back true; } Hold (StaleElementReferenceException E) {// Return is true because the stale element reference means that the element // is no longer visible; back to true; }}  

Force a user to watch the whole video -


I find that forces the user to watch the entire video, and at the end of each video there would be a small button A javascript function that triggers any video or reader thanks

I have a similar concept Wanted to apply and i tried to ask for help but i did not get the jquery dome manipulation And the following is the code applied to it:

  & lt; Html & gt; & Lt; Top & gt; & Lt; Script src = "http://www.youtube.com/player_api" & gt; & Lt; / Script & gt; & Lt; Script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "youtubevideo" & gt; & Lt; / Div & gt; & Lt; Script & gt; // Create player var youtubevideo; Function onYouTubePlayerAPIReady () {youtubevideo = new YT.Player ('youtubevideo', {height: '390', width: '640', Video ID: 'HS5 CFP 8 N_GE', // Video autoplay here, player to keyboard Hide and Disable Keyboard Prevent users from running the video. NB: Autoplay only works on PCs iOS 8 also compels basic controls Player Wars: {'rel': 0, 'showinfo' : 0, 'Autoplay': 1, 'control': 0, 'Disablekb': 1, 'Modest branding': 1}, Event: {'On 'Change Onpleyr Reedi "Onstet' Onpleyrstet change}}); }player read (event) on function {event.target.playVideo (); } // It tells the YouTube player to trigger the Hello () function while functioning on the PlainState Change (Event) {if (event.data === 0) {hello (); }} // hello function uses ajax to fetch html after the video ends. This jquery DOM manupulation function Hello () {var i = 'html goes here'; $ ("Body"). Html (i)} & lt; / Script & gt; & Lt; / Body & lt; Html & gt; You can see it here: 

You can apply it to many players, I have used YouTube as an example.


java - org.springframework.beans.factory.BeanCreationException Spring Configuration -


When I try to enable the transaction manager with an annotation in the spring, I get an exception.

A codecourse:

  @configuration @ EnableTransactionManagement @Import (value = {propertyConfiguration.class}) public class AppConfiguration {@Autowired PropertyConfiguration propertyConfiguration; @ Bean Public Emoji Emoji () back to new emo ())}}  

I found this excel:

  org.springframework.beans.factory .BeanCreationException: Error creating bean with name 'org.springframework.aop. Config.internalAutoProxyCreator ': The instantiation of Bean failed; Nested exception org.springframework.beans.BeanInstantiationException: [org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator] failed to instantiate: the creator threw an exception; Nested exceptions Java Lung Any method of law: org.springframework.core.CollectionFactory.createConcurrentMapIfPossible (I) Ljava / util / Map; Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean (AbstractAutowireCapableBeanFactory.java:1093) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1038) org.springframework.beans.factory.support. AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:504) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:476) org.springframework.beans.factory.support.AbstractBeanFactory $ 1.get Object (AbstractBeanFactory.java .33.33) Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java Month 30) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.javaociety99) org.springframework.beans.factory.support .AbstractBeanFactory.getBean (AbstractBeanFactory.java: 199) org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors (Postprocessor RegistryJetajeva 2020) org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors (A BitCast ApplicationsContax.Java.615) org.springframework.context.support.AbstractApplicationContext.refresh (AbstraStupContex. Jawaav 6565) org.springframework.context.annotation.AnnotationConfigApplicationContext. & Lt; Init & gt; (AnnotationConfig applicationsContax.Java: 84)  

Any ideas? Thanks


docusignapi - Docusign|Salesforce In-Person Signing for iPhone -


I understand that signature of individual person is not supported by Dokusin publisher's action in Salesforce1 due to lack of screen rotation It seems that Dosicin should be supported by the iOS app for the iPhone. I am interested in seeing that there is no way around this border, possibly using both apps.

Thank you in advance.

is a beta, there is an opt-in feature for SalesPhone in Doku Sign, which is the usual DocuSign tagging / Instead of using the screen, DocuSign allows iOS apps to be launched. You may be able to use that.

Go to the Docusain Admin tab, select the envelope, go to the Send Settings section, and tick the box "Enable Docuin Mobile App Tagging for" Salesforce 1 (beta). "

Screen Shots of Salesforce Configuration of Doku Sign

< / Html>

r - How to deal "Error in model.frame.default(formula = y ~x ) variable lengths differ (found for)" in IRLS function -


I am trying to recycle the least square method to estimate the coefficient of the equation:

y = A0 + a1 * cos (2 * pi / 365 * x) + b1 * sin (2 * pi / 365 * x) + c1 * x

When I fit this equation I use IRLS to get an error:

  x  

How can I handle this problem? What is the other method of IRLS to estimate coefficient?


How to prevent multiple binding to the same selector in Jquery? -


  $ ("। पोस्ट")। पर ("क्लिक करें", show_hide_posts); // कॉलबैक फ़ंक्शन तृतीय-पक्ष एजेक्स प्लगइन $ .fn.almComplete = function (alm) {$ ("। Post")। पर ("क्लिक करें", show_hide_posts); }  

जब दस्तावेज़। मैं बाध्य करने के लिए क्लिक करें। जब एजाक्स के माध्यम से अधिक सामग्री लोड हो जाती है तो मैं नई पोस्ट बाँध करने के लिए कॉलबैक फ़ंक्शन का उपयोग करता हूं। यह पुरानी पोस्ट ठीक से काम नहीं करता है।

show_hide_posts के पास एक साधारण हैक्लस है, यह जांचने के लिए कि क्या पोस्ट को दिखाई देने पर छिपाया जाना चाहिए या नहीं। नई पोस्ट लोड होने के बाद, यह है क्लास चेक पुराने पदों पर विफल रहता है, लेकिन फिर भी नई पोस्ट पर काम करता है।

  फ़ंक्शन show_hide_posts () {e.preventDefault (); अगर (! $ (यह) .hasClass ('बंद')) {// पोस्ट करें $ (इस) .addClass ("बंद"); } अन्य {// शो पोस्ट $ (यह) .removeClass ("बंद"); }}  

क्या मैं यह व्यवहार एक ही चयनकर्ता को एक से अधिक बार बाइंडिंग का परिणाम देता हूं? या क्या मैं कुछ और याद कर रहा हूं?

मैं यह व्यवहार उसी चयनकर्ता को बाइंड करने का एक परिणाम अधिक एक बार से अधिक?

हाँ, आप एक से अधिक बार बाध्य हैं।

मान लें कि आपके पास निम्न HTML है:

  & Lt; div वर्ग = "पोस्ट" & gt; & Lt; div class = "post" & gt; ए & lt; / post & gt; & Lt; div वर्ग = "पोस्ट" & gt; बी & lt; / post & gt; & Lt; / div & gt;  

आप कॉल करते हैं

  $ ("। पोस्ट")। पर ("क्लिक करें", show_hide_posts);  

अब अब और बी पर एक क्लिक हैंडलर है इसके बाद आप एजेक्स / html को अपडेट कर सकते हैं:

  & lt; div class = "posts" & gt; & Lt; div class = "post" & gt; ए & lt; / post & gt; & Lt; div वर्ग = "पोस्ट" & gt; बी & lt; / post & gt; & Lt; div वर्ग = "पोस्ट" & gt; सी & lt; / post & gt; & Lt; div वर्ग = "पोस्ट" & gt; डी & lt; / post & gt; & Lt; / div & gt;  

और कॉल करें:

  $ ("। पोस्ट")। पर ("क्लिक करें", show_hide_posts);  

अब और बी के पास दो हैंडलर हैं, जबकि C और D एक है।

जब दस्तावेज़। मैं बाध्य करने के लिए क्लिक करें। जब एजाक्स के माध्यम से अधिक सामग्री लोड हो जाती है तो मैं नई पोस्ट बाँध करने के लिए कॉलबैक फ़ंक्शन का उपयोग करता हूं। यह पुरानी पोस्ट ठीक से काम नहीं करता है।

सही है, इसलिए समाधान .post से सीधे नहीं है:

  $ ('। पोस्ट')। पर ('क्लिक करें', '.post', show_hide_posts);  

यह गतिशील रूप से जोड़े गए पदों के किसी भी संख्या के लिए काम करता है, और .posts के भीतर .posts के पास एक ही हैंडलर है, और कभी भी नहीं है

विविध नोट्स :

आपको सबसे ज्यादा ऐसा नहीं करना चाहिए:

  ई। चूक को रोकें();  

इससे बहुत सी समस्याएं हो सकती हैं।

आप भी प्रतिस्थापित कर सकते हैं:

  यदि (! $ (यह) हैक्लास ('बंद')) {$ (यह) .addClass ("बंद"); } और {$ (यह) .removeClass ("बंद"); }  

के साथ:

  $ (यह) .toggleClass ("बंद");  

c++ - Best way of handling level 2 commands with Boost ProgramOptions -


I'm interested in making an executable that takes level 2 commands on the command line - such as git commit and git add are your separate orders within the same EXE, so I have a question: is there any way to simplify it with programmers? I know that I can define different schemes and then check the argv [1] against a particular string, but I hope the way of cleaner is the way. Thanks!

You can use:

  #include & lt; Boost /program_options.hpp> # Include & lt; Iostream & gt; # Include & lt; Algorithm & gt; #include & lt; Iterator & gt; Name space po = boost :: program_options; // Auxiliary function to simplify the body Template & lt; Class T & gt; Std :: ostream & amp; Operator & lt; & Lt; (Std :: ostream & os, const std :: vector & lt; T & gt; & amp; v) {copy (v.begin (), v.end (), std :: ostream_iterator & lt; t & Gt; (OS, ")); return OS;} int main (int ac, char * av []) {try {po :: options_description desc (" allowed option "); (" Command_opt ", po :: value & Lt;) (generate "help", "help message") ("command", po :: value  std :: vector & lt; std :: string & gt; ;), "Command option"); Po :: positional_options_description p; P.add ("command", 1); P.add ("command_opt", -1); Po :: variables_map vm; Po :: store (Po :: command_line_parser (ac, av). Options (desc) .positional (p) .run (), vm); po :: notify (vm); if (vm.Count ("help")) {std: : Cout & lt; & lt; "Usage: Options_details [options] \ n"; Std :: cout  Vm [" command "]. As & lt; std :: string & gt; () << "\ N";} If (vm.count ("command_opt")) {std :: cout  

But AFAIK you need to check the logic option, which option is compatible with other options because there is no dependency system in boost program options.

A separate option group can be helpful for the usage text generated by grouping each order options.


android - Facebook SDK and sharing a Play Store app link with ShareDialog issue -


After

I am trying to share a link using ShareDialog (my Google Play app link) from Facebook SDK, but The problem is that when the URL is in my app's Google Play link, other information is not being displayed properly ... Actually it's only displaying links from Google Play without a name or description!

Here is the code:

  FacebookDialog shareDialog = New FacebookDialog.ShareDialogBuilder (this) .setLink ("https://play.google.com/store/apps/details ? Id = & lt; myapp & gt; ") .setDescription (" Test ") .SetName (" Test for Facebook ") .build (); UiHelper.trackPendingDialogCall (shareDialog.present ());  

I tried everything and actually worked with other URLs (displaying names, details, captions etc.), but not with the app's URL.

Do anyone know why Google Play will not work with text, description or captions?

Actually if you have contentUrl (in 4.0) or link (in your case), it overrides name , description , etc. You do not need to give it to other things because after this it The responsibility for url host is made when it should be posted on the Facebook timeline.

However, if you want to share something with your app link by the message from user . Then I have the suggestion to go to Graph API (I was wasting 2-3 days via ShareApi / ShareDialog in posting something like this, but only with using Graph API

Use the Code Graph API to share:
  // Fixed time to use when sharing messages on Facebook Time Line FACEBOOK_ERROR_PERMISSION = 200; Private static final string PARAM_EXPLICIT = "FB: explicitly shared"; Private static final string PARAM_GRAPH_PATH = "/ mi / feed"; Private static final string PARAM_MSG = "message"; Private static final string PARAM_LINK = "link"; // Create parameter for share final bundle params = new bundle (); Params.putBoolean (PARAM_EXPLICIT, true); Params.putString (PARAM_LINK, burdingout.app_url URL); // If the message is empty, only our link will be posted. String message = "This is a sharing message"; If (! TextUtils.isEptyy (message)) params.putString (PARAM_MSG, message); // Post a message on the timeline Send a request via Facebook's Graph API New GraphRequest (AccessToken.getCurrentAccessToken (), PARAM_GRAPH_PATH, Ultimate, HttpMethod.POST, New GraphRequest.Callback () {@Override Public Zero onCompleted (GraphResponse GraphResponse) {searchDialog.dismiss (); if (graphResponse.getError () ==} {// success in posting on timeline: Logger.toastShort (R.string.msg_share_success); Logger.debug (TAG, "success" . + GraphResponse);} else {FacebookRequestError error = graphResponse.getError (); if (Error.getErrorCode () == FACEBOOK_ERROR_PERMISSION) // Asked during the cancellation permission, msg Logger.toast There was an error while posting messages to Long (R.string.msg_share_permission); else // Logger.toastShort (R.string.msg_share_error); Logger .error (TAG, "Error:" + Error);} // button again Enable if profile and access token a again non-null if (profile. GetCurrentProfile ()! = Faucet || AccessToken.getCurrentAccessToken ()! = Null) mShareButton.setEnabled (true); }}) ExecuteAsync ();  

javascript - Django on Pythonanywhere IOError/RuntimeError -


I have my CSS / JS up and running. I added more features and then uploading them github I saw that they used to work on python, then I went home. Later in the day I opened my site and saw that CSS / JS is not loading. However, the icon is loading in the same folder. I tried to remove my project and tried cloning again. I also tried to delete the site and restore it without any result. I recently found these errors:

2015-03-16 10: 36: 03,205: IOER: Write Error 2015-03-16 10: 36: 03,205: Runtime Error: Generator

This is just an indication that the client disconnected during the response ended happened. Usually this means that the user went to a different page or reloaded or something like that.


parse.com - Pricing: Are push notifications really free? -


According to

, push notifications are free up to 1 million unique recipients.

API calls are free, up to 30 requests / seconds.

I have to make sure there is no catch here.

An example would be obvious: I have 100 user members. I will send them weekly push notifications in one month, this will be a "blast" push, with 100 recipients. Is it free level? Will it count as 4 API calls, 400 API calls or any other amount?

Users 100/1 unique recipient limits advertised, so that should be fine.

Remember that 10sec is also time-out, so the only way to push 100k within the free-level processing limit is to create a scheduled job that spends about 2 hours (which is 15 rak / second Secure rate) pushing the state by pushing, so that you can pick up later where you left off.

Say no hidden grip (you probably will need to find those experiences), I think that the only acceptable fact in plain sight is that the free level is only one ( 1) Scheduled jobs allow any other long-running processing - and there will be bound to be some 100k users - the job must be shared, from which one-on-one-job-work-now-logic Will.


ios - Search Icon Distorted in iPhone 6 Plus - Squashed to an Egg Shape -


I have a search bar in the navigation title view and two buttons in the form of a bar button item. After rotating the device several times, the size of the search icon becomes crushed and the shape becomes like an egg. See the following picture

Enter image details here

Here's a The minimum implementation is that I can get it to reproduce:

  • Create a new project from the template Single View Application

  • go to the main storyboard and embedded in a navigation controller (editor> embed> navigation controller)

  • Replace ViewController.m : @ View Interface Viewer () @ Property (Non-Atomic, Strong) UISearchBar * searchBar; @protecti (nanatomic, strong) UIBarButtonItem * addButton; @property (non-standard, strong) UIBarButtonItem * editButton; @end @implementation ViewController - (zero) viewDidoadload {[Super Viewedload]; // Add a search bar _ searchbar = [[UISAxchangebar] init]; _searchBar.placeholder = @ "Search"; Self.navigationItem.titleView = _searchBar; // Two button Add _addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemAdd goal: self action: nil]; _editButton = [[UIBarButtonItem alloc] initWithTitle: @ "edit" style: UIBarButtonItemStylePlain target: zero operation: zero]; Self.navigationItem.rightBarButtonItems = @ [_ editButton, _addButton]; } @end

  • compile and run it in iPhone 6+ simulator or iPhone 6+ device. Rotate the device several times and you will gradually get corrupted by search icons.

Additional notes:

  • This is only done on iPhone 6 Plus We have tested on many other devices (iPhone 6, with iPhone 5 only) And this is not a problem.
  • If we change the placeholder with UISearchBar with any other string (other than "search"), then we see the distortion Does not. Text after "<">

We actually have the same issue with a distorted UISearchBar icon - only iPhone 6 going on / 7 Plus

for now we have only method to reset the frame of a crazy workaround and icon layoutSubviews of UISearchBar with Swizzling

welcome any better solution Is: - ..)

  Import UIKit Personal var Default Imageviews: CGSize? = Blue Personal Let's Burn: (UISearchBar.Type) - & gt; () = {Original selector in search bar = # selector (searchBar.layoutSubviews) Let's swizzledSelector = #selector (searchBar.proj_layoutSubviews) Basic method = class_getInstanceMethod Give (search byer, original selector) Let's swizzledMethod = class_getInstanceMethod (searchBar, swizzledSelector) method_exchangeEmplementations Law, swizzledMethod)} detail UISearchBar {Open override class func initialize () {// Make sure it is not a sub-class guard === UISearchBar.self else {return} swizzling (self)} // Mark: - method Burning Function, proj_layoutSubviews (Animated: Boole) {self.proj_layoutSubviews (Animated: Animated) Go if imageView = self.g etSearchBarIcon (keeping in mind: self) {if the defaultImageViewSize = defaultImageViewSize {imageView.frame.size = defaultImageViewSize} else {defaultImageViewSize = imageView.frame.size}}} private func getSearchBarIcon (Inwu Views: UIView) - & gt; UIImageView? {For subview in View.subviews {if subview.isMember (K: UIImageView.self), please give imageView = subview as? UIImageView {return imageView} and see if the image vview = getSearchBarIcon (inView: subview) {return imageView}} return blue}}  

gzip - How does numpy handle mmap's over npz files? -


I have a case where I would like to open a compressed MMP file using Mmapi mode, but not any search Find documentation about how it will work under the cover. For example, will it uncompress the collection in memory and then it's MMAP? Will it remove compression on the fly?

The documentation is absent for that configuration.

Based on the short answer, code view, archive and compression, np.savez < / Code> or gzip , regardless of accessing files in mmap_mode . It is not a matter of how it is done, but it can be done at all.

np.load function

<> elif isinstance (file, gzip.GzipFile): Fid = seek_gzip_factory (file) ... If magic.startswith (_ZIP_PREFIX): # ZIP file NpzFile tmp = own_fid own_fid = wrong (.npz value) # transfer ownership back to the file NpzFile (FID, own_fid = tmp) ... if mmap_mode: return format.open_memmap (file , Mode = mmap_mode)

Look at np.lib.npyio.NpzFile . A npz file .npy is a Zip archive files a dictionary (like) object to load, and when you access them, individual variable (Array ) (Like obj [key]). There is no provision in its code to open those personal files in mmap_mode`.

It is very clear that the file created with np.savez can not be used as an mmap. Zip archive and compression is not a single form of gzip compression saved in the np.load first of what is addressed with np.save <.

But / code> and then gzipped ? Note that format.open_memmap is not called the file fid (which may be a gzip file). Details on

and open_memmap on np.lib.npyio.format . Its first test is that the file should be a string, not an existing file feed. This work expires to work on np.memmap I do not see any provision in that function for gzip .


jboss7.x - EJB 3.1 - Set stateful timeout for all beans -


OK FAQ, how do I set deadlines for all EJB 3.1 statefool beans in Zebaus AS7?

I have tried different combinations in ejb-jar.xml such as:

   
  Reason by: java.lang.IllegalArgumentException: JBAS011084: Component classname is zero  

I know that I can also set up in access-timeout standalone.xml

I also know that I will be using @StatefulTimeout < / Code>, but I'm looking for a global default, it's astonishing that I can not see this document anywhere


android - Loading Image using picasso inside AsyncTask -


I am using Picasso to load the image as background for my activity, I have an Async Task I want to use, while the image

  Private Class RemoteDataTask AsyncTask is expanded; Zero, zero, zero, and gt; spreads out;  

; {@Override Secure Zero on PreExecute () {super.onPreExecute (); MProgressDialog = New Progress Diablog (main activity.); MProgressDialog.setMessage ("Chargement ..."); MProgressDialog.setIndeterminate (wrong); MProgressDialog.show (); } @ Override protected volume doinbackground (zero ... parameter) {Picasso. (Main Activity.). Load ("http://tv2.orangeadd.com/mediacenter-data/ofc__bg_home.jpg"). Ino (background, new com.squareup.picasso.Callback () {@Override public void onSuccess () {mProgressDialog.dismiss ();} @ Override error on public zero () {}}); Return tap; } @Override Protected void onPostExecute (zero result) {}}

This is always showing an error and forcing my application to quit!

thanks guys :)

  public zero load image inbound () {MProgressDialog = New Progress DIOLOG (main activity.); MProgressDialog.setMessage ("Chargement ..."); MProgressDialog.setIndeterminate (wrong); Goal target = new goal () {@PropareLoad Override publicly (double argh 0) {mProgressDialog.show (); } @ Override Bitmap Loaded on Public Zero (bitmap AGR0, Loaded FR1) {background.setImageBitmap (arg0); MProgressDialog.dismiss (); } @ Override Bitmapfiled on Public Zero (Dryable RGET) {// TODO Auto-Generated Method Stub mProgressDialog.dismiss (); }}; Picasso Together (main activity.) Load ("http://tv2.orangeadd.com/mediacenter-data/ofc__bg_home.jpg") .into (target); }  

php - If isset Session, add to $variable or $variable='0' write with one line -


I have php code below and I want to use it in inline (one line) . It should not repeat $ _SESSION name

  $ view = if (isset ($ _ session ['customer-view']) {$ view = $ _SESSION ['cients-view']; } And {$ visual = '0';}  

As you see it $ view three times and $ _ session twice < / Strong> I repeat it with a single line in an easy way.

Hope you understand the question.

Thanks,

SL

You want it to:

  $ view = isset ($ _ Session ['customer-view'])? $ _SESSION ['Cients-view']: '0';  

I do not understand why in your code $ view = if (... ? If there is no return value. / P>


javascript - how do I set some default value for a check box or a radio button if user do not check the check box or select a button -


I have a dynamically formatted form using the bootstrap form elements, in which I have a check box and radio There are options to add buttons. When I click the submit button, the data is sent to the database as json in the form. I am using the following javascript function to submit the form

  $ ('# customform'). ("Submit", function) {var formData = JSON.stringify ($ ("custom form"). SerializeArray ()); var formURL = $ (this) .attr ("action"); $ .ajax ({Url: formURL, Type: "Post", Data: FormData, Content Type: "Application / Jason; Charset = utf-8", Success: Work (Data) {$ ("# myAlert"). Show (); }, Failure: function (error) {}}); event.preventDefault ();});  

The problem is that, whenever the check box is left unchecked or no option is selected for the radio button, then no data is sent to the database related to these areas. is.

Is there any way I can use to set some default values ​​for these form fields so that I get some value in the database for these areas, even if the fields are not selected.

In addition to the comments of Mark B, you can also set default values ​​in the database for those fields, which are normally set to use the checkbox as separate.


java - SoapUI. Build from source code fails with "unresolved dependencies" -


Has anyone ever successfully constructed soap using sources?

According to Readme, but it is always unsuccessful with unsatisfied dependencies.

I thought that I can only download the source, I can update the Maven indecision and build the project. Or should I make any additional changes?

is a first error because "soap" was not found. It seems that Sopri is used but they have not installed it in jars. I have discovered the issue on the Internet and found a few available copies of them here:

  http://corp.array.ca/nest-web/mavenrepo/com/install4j/i4jruntime /5.1.14/i4jruntime-5.1.14.jar  

then I installed manually issue:

  mvn install: install-file - dfile = i4jruntime.5.1.14.jar-DgroupId = org.sonatype .install4j - Dartifakt ID = i4jruntime -vitrn = 5.1.14 -dpaking = jar -dinerepm = true - Direct Krenksesm = true  
< P> Another error is because the SOI uses it to check It does that when compiling the JDK 6. Compiled for the project, it fails. I commented on the execution of the plugin in Palm and the project is ok. Just open pom.xml file and delete the following lines:

  & lt; Executions & gt; & Lt; Execution & gt; & Lt; ID & gt; Examination of animal sniffer & lt; / Id & gt; & Lt; Step & gt; Process sections & lt; / Step & gt; & Lt; Goals & gt; & Lt; Goal & gt; Check & lt; / Target & gt; & Lt; / Targets & gt; & Lt; / Execution & gt; & Lt; / Hanging & gt;  

Still seem bug these Sopudi should be notified.


python - Numpy arrays with compound keys; find subset in both -


<2> <2> <2> <2> <2> <2> <2> <2>

  (19133l, 12l) ( 248 L, 6L)  

In each case, the first 3 fields make an identifier.

I want to reduce the larger matrix so that there are rows with only that identifier which exists in the second matrix (248 L, 12L) How can I do this?

Then I would like to sort it so that the array can be indexed with first value, second value and third value so that (3 3 4) (3 3) etc. Is there a multi area sorting function?

Edit:

I have tried Panda:

  df1 = DataFrame (arr1.astype (str)) Df2 = DataFrom (arr2 .astype (str)) df1.set_index ([0,1,2]) df2.set_index ([0,1,2]) outside = merge (df1, df2, how-to = "inner") print (out.shape)  

But the result in this (0,13) size

Use Pandas .

Allows multiple keys.

To pierce your dataframe, first set the index in the first three columns (use drop = False, inplace = true ).

In general, the arbitrary dataframe runs out of narrow steam very quickly for manipulation; Your default thing should try Panda, besides a lot more performant.


Unicode working on Windows but not Red Hat Linux : Java -


In Java, I am generating a Unicode character file.

When I run my program in Windows (Jebus) and open the file (CSV). It displays Unicode characters (Norwegian and Icelandic) in superiority.

But when I'm deploying Red Hat Linux (in the same version, Jebus) to the same server, run the program, create and download the file, and when I look in Excel it All unicode characters are distorting. / P>

Can you please inform any local Linux setting, due to which the Unicode is being malformed? Or where change is needed?

  file author authors = new FileWriter (fileName); Writer.append (new string (data .to string). GetBytes ("UTF-8"), "UTF-8"); Writer.flush (); Writer.close (); // data stringbilder type  

I also have ISO8859_1

update 1

I have a system encoding Checked: Using System.getProperty ("file.encoding") found that

Windows is CP1252 and Linux is UTF-8

Update 2

When I print it used in Linux:

  log.info (new string (data.string (.) GetBytes ("UTF-8"), "UTF-8" ));  

All of these outputs are looking fine, but when I put it in the FileWriter extension filename.csv, it is not displaying correctly.

  data   

string "Post-text" itemprop = "text">

  data.toString ()  

bytes

  Data.toString () GetBytes ("UTF-8") string (data.toString (.) GetBytes ("UTF-8"), "UTF-8")  

string

Code>

bytes

  writer.append (new string (data.toString (.) GetBytes ("UTF-8"), "UTF-8 "));  

Try only one conversion from the input encoding to a string and then type the string. Then data.toString () will need to know what it is reading whether it is encoding. Does data support conversion from different code pages?

  Author .append (Data. Two string (codepage));  

angularjs - display tool tip over disabled select filed in html -


I need to pop up the device tip on select areas of disability, I currently use angular-foundation tooltip, I'm using Mozagez v1.3.7. Tooltip to display content.

Please suggest possible solutions to me

Thanks in advance!

It was not used in that version of angular but I remember it was not working. You can always wrap your selection field in a div and add your tooltip instead of your fields.

  & lt; Div popover-trigger = "mouseenter" popover = "I appeared on the mouse!" Style = "display: inline-block; width: 200px;" & Gt; & Lt; Disabled & gt; Select & lt; Option value = "Volvo" & gt; Volvo & lt; / Options & gt; & Lt; Option value = "saab" & gt; Saab & lt; / Options & gt; & Lt; Option value = "Mercedes" & gt; Mercedes & lt; / Option & gt; & Lt; Option value = "Audi" & gt; Audi & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Div & gt;  

See one.


javascript - CI+ Communication in the HbbTV platform -


How does anybody communicate with the CI + CAM module through HBBTV 1.2.1 / 1.1.1?

We have created these items

  & lt; Object Type = "App / OffFormAgent" id = "oipfDrmAgent" & gt; & Lt; / Object & gt; & Lt; Object type = "App / OEPIF GatewayInfo" id = "GatewayInfo" & gt; & Lt; / Object & gt;  

Before sending data to the CI + module, we need to know the CI + status and the correct value of the isCSPGCIPlus supported in Samsung TV 2014. Other TVs like LG, Panasonic, Westel have wrong values ​​

... and now we are called

  drmagent = document.getElementById ('oipfDrmAgent'); Drmagent.onDRMSystemMessage = this.onDRMMessage; Drmagent.onDRMMessageResult = retrieve this.onDRM; Ret = drmagent.sendDRMMessage ("application / vnd.oipf.cspg- hexbury", '0x0108113101190000', 'vase: DVB: casystemid: 3478');  

And we have recovered the message number [], as a result the message is zero object and the result in the code is 2.

  onDRMRetrieve: function (msgID, resultMsg, resultCode) {var drminfo = document.getElementById ('drminfo'); Drminfo.inner HTML + '& lt; Br / & gt; Recover DRM message '+ +' + result message + + 'result code; Note: ETSI TS 102 796 V1.1.1 (2010-06) has defined the sending of messages through  sendContentPurchaseMessage () , but this function is not defined. 

We have three questions: 1) How to pass a message string through the sendDRMMessage through '0x0108113101190000'? 2) We should be aware of getting the CSSN number from the CIN + Card. 3) Are there any security related problems?

Regards, STN


node.js - Write in a Json file with Nodejs -


मेरे पास थोड़ा नोडज स्क्रिप्ट है

  var slug = require ('slug'); Var एफएस = आवश्यकता ('एफएस'); Var फ़ाइल = '../_data.json'; विन कॉन्फ़िग; Fs.readFile (फ़ाइल, 'utf8', फ़ंक्शन (त्रुटि, डेटा) {if (err) {console.log ('त्रुटि:' + त्रुटि); वापसी;} config = JSON.parse (डेटा); var slugTitle = slug ('शीर्षक')। ToLowerCase ()। विभाजन ('।')। (""); Var newPost = {"description": 'mydescription', "title": 'mytitle'}; config [slugTitle] = newPost ; Fs.writefile (फ़ाइल, JSON.stringify (config, null, 2), फ़ंक्शन (त्रुटि) {if (err) {console.log (err);}}}); rl.close ();}); }); }); });  

स्क्रिप्ट ठीक काम करती है, लेकिन नया आइटम मेरी जेसन फाइल के निचले भाग में जाता है। क्या जेसन के शीर्ष पर नया प्रवेश लिखना और अन्य मदों के क्रम को परिवर्तित नहीं करने का कोई आसान तरीका है।

मेरा जेसन कुछ ऐसा है:

  {"शीर्षक": {"शीर्षक": "ब्लग सेक्सी", "विवरण": "वर्णन करने के लिए"}, "पृष्ठ 1": {"शीर्षक": "पृष्ठ 1", "विवरण": 'विवरण लो लो'} }  

मैं harpjs पर एक और कोड निर्माण का उपयोग कर रहा हूँ, जो ऊपर से नीचे तक शुरू करके जेसन पढ़ता है। मैं इस कोड को संशोधित नहीं करने का प्रयास कर रहा हूं।

पहले से धन्यवाद।


web services - F# Web API - Exception has been thrown by the target of an invocation -


Using Owen I am trying to create an F # web service, I have got 2 tutorials online and both of them are giving me the error. The exception of "an appeal is thrown by the exception" on the same line of code, but it does not understand why this is happening

  used server = WebApp. Start & lt; Startup & gt; (BaseAddress)  

Below is a small piece of code. I am using another more complex example forfunandprofit website example number 3 can be found at

 < Code> Namespace FSharpWebAPIOwin Open OVIN Open System. Web. Htp open system.clallions Generic Open Maikrosoftkonkhosting Open Systems Module key = Startup () = Member Yhksng (App: IAppBuilder) = config = new HTTP Configuration () = route to = ConfigkrouteskMapHttpRoute ( "default", "API / {Controller} / {id} ") route Default. Add ("ID", RootPamator. Optional) App. Usweb (config) | & Gt; Neglect type HelloController () = Receive the API Controller () member. () = "Hello" [& lt; EntryPoint & gt;] Main Argument = Enter baseAddress = "http: // localhost: 8000" Use server = WebApp.Start & lt; Startup & gt; (BaseEdrace) console.light line ("press enter to exit ...") console.readline () | & Gt; Ignore 0  

exception details

  system. Reflection. Target Invocation exception was rampant HResult = -2146232828 Message = exception is thrown by the target of an invention Source = mscorlib StackTrace: on System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal on System.RuntimeMethodHandle.InvokeMethod (target object, [] arguments, Signature sig (Object obj, BindingFlags invokeAttr, binder binder, [] parameter), Object Boolean manufacturer object (object obj, object [] parameter, object [] logic) on system .Reflection.RuntimeMethodInfo.Invoke System.Reflection.MethodBase.Invoke , CultureInfo Culture Object) (object obj, object [] Aramitr) on Owin.Loader.DefaultLoader. & Lt; & Gt; C__DisplayClass12. & Lt; MakeDelegate & gt; B__b (IAppBuilder Builder) on Owin.Loader.DefaultLoader & Lt; & Gt; C__DisplayClass1. & Lt; Load emailing & gt; In b__0 (IAppBuilder Builder) on Microsoft.Owin.Hosting.Engine.HostingEngine.ResolveApp (StartContext reference) Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start (StartOptions option) on Microsoft.Owin.Hosting.Starter.HostingStarter.Start Microsoft .Owin.Hosting.Engine.HostingEngine.Start (StartContext reference) tartOptions options) (IServiceProvider services Microsoft.Owin.Hosting.WebApp.StartImplementation on (S, StartOptions options) (StartOptions options Microsoft.Owin.Hosting.WebApp.Start ) Microsoft.Owin.Hosting.WebApp.Start [TStartup] (on StartOptions options) Microsoft.Owin.Hosting.WebApp.Start [TStartup] (string url) [on FSharpWebAPIOwin.main.main (string] argv) in C: \ Users \ amulligan \ Desktop \ API \ ConsoleApplication2 \ ConsoleApplication2 \ Program.fs: Line 30Interception: System.ioFileLoadException HResult = -2146234304 Message = File or Assembly 'System. Web. A clear definition of the assembly located in one of the HTP, version = 5.2.3.0, culture = neutral, Lokkaten = 31bf3856ad364e35 'could not be loaded or its dependency does not match assembly reference. (Exception from HRESULT: 0x80131040) Source = ConsoleApplication2 filename = System.Web.Http, Version = 5.2.3.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 FusionLog ==== Pre-bind state information === LOG: User = CCS \ Amuligon Log: display name = System.Web.Http, version = 5.2.3.0, culture = neutral, public keychain = 31bf3856ad364e35 (fully specified) LOG: Appbase = file: /// C: / user / amulligan / Desktop / API / Console Application 2 / Console Application 2 / Bin / Debug / Log: Initial Private Path = Sh NY Calling assembly: Kansolavedn 2, Version = 0.0.0.0, Culture = neutral, public Ketan = zero. Log: This starts with the default load reference bound. Log: Using the application configuration file: C: \ User \ amulligan \ Desktop \ Api \ ConsoleApplication2 \ ConsoleApplication2 \ bin \ Debug \ ConsoleApplication2.exe.config Log: Using the Host Configuration File: Log: C from the machine configuration file Using: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ config \ machine.config Log: Post-Policy Reference: Systems. Web. Trying to download the new URL file: /// C: / User / Ameligen / Desktop / API / Console Application 2 / ConsoleApplication2 / bin / Debug / PHP / Version / 5.2.3.0, Culture = Neutral, PublicKey Tokens = 31bf3856ad364e35 Log: System.Web.Http.DLL. WRN: Assembly name comparison mismatch: Major version ERR: failed to complete Assembly Setup (HR = 0x80131040) Finish the check on StackTrace: FSharpWebAPIOwin.main.startup. Configuration (IAppBuilder app) InnerException:  


lotus notes - xPages dataTable page -


I have a data table on my xpage that shows for example 10 rows (repeat range, line = " 10 ") While using pager, how do I know when I navigate through the records, what is the current page number?

After switching between pages I would like to return and open the data. <<>

I think that to get the behavior you want The best route is & lt; Xe: pager serve / & gt; Controls from ExtLib, which serves to store the state of the given pager and when you return to the page, you can restore it. Here is the example of Brad Balasatis how to use it:


javascript - Alert not working in firefox but working in chromium -


jquery:

  $ ("दस्तावेज़")। तैयार (कार्य () {अलर्ट ('यह काम कर रहा है'); $ ("। Add_new") क्लिक करें (फ़ंक्शन () {$ ("। टेबल")। Hide (); $ ("# frm")। Show ();}); $ । ( ".insert_form") प्रस्तुत (समारोह () {var sending_data = { "कार्रवाई": "सम्मिलित"}; sending_data = $ (this) .serialize () + "& amp;" + $ परम (sending_data); $ .ajax ({प्रकार: "पोस्ट", यूआरएल: "test.php", // सापेक्ष या निरपेक्ष पथ फ़ाइल डेटा response.php रहे हैं: sending_data, सफलता: समारोह (return_data) {चेतावनी (return_data); // यह नहीं है काम कर रहे।      }     });   }); });  

test.php

  & lt;? Php गूंज $ _POST ['कार्रवाई']; ? & Gt;  

HTML:

  & lt; form method = "post" id = "frm" style = "display: none;" वर्ग = "insert_form" & gt; & Lt; input type = "text" value = "" आवश्यक = "आवश्यक" प्लेसहोल्डर = "अपना नाम दर्ज करें" name = "user_name" / & gt; & Lt; इनपुट प्रकार = "सबमिट करें" मान = "सबमिट करें" / & gt; & Lt; इनपुट प्रकार = "रीसेट" मान = "स्पष्ट" /> & Lt; / प्रपत्र & gt;  

सबमिट करने के बाद मुझे संदेश प्रदर्शित करना होगा। मैं सिर्फ सतर्क () का उपयोग कर परीक्षण कर रहा हूं लेकिन चेतावनी बॉक्स दिखाई दे रहा है। कृपया मदद करें।


c++ - OPENGL- triangle moving -


I have a problem with my OpenLL project. I have to make moving triangle with X-X. All have to turn around. I have made it but I do not know what is happening with acceleration ...

  #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; # Include & lt; Iostream & gt; # Include & lt; Math.h> # Include & lt; Iomanip & gt; # Include & lt; Time.h> #include "glut.h" # included "math.h" using namespace std; Float x = 0, y = 0, angle = 0, agglen = 0, q = 1, w = 1, e = 1, qn = 0, wn = 0, n = 0; Double xn = 0, c = 0; Int licznik = 0; Int zmiana = 0, a = 0; Bull flag = true; Fixed zero timer callback (int value) {if (xn! = X) {licznik ++; // Odlijny Collagen Kletek X + = XN / 100.0; Angle + = agglen / 100.0; Q + = qn / 100.0; W + = wn / 100.0; E + = N / 100.0; If (q> 1) {q = 0; } If (w> 1) {w = 0; } If (E & gt; 1) {E = 0; } GlutPostRedisplay (); GlutTimerFunc (50, timer callback, value); // ustawienie ponownego wywołania naszej funkcji "timer callback" po 100 ms} if (licoscic == 100) {if (a == 0) {x = -0.8; GlutPostRedisplay (); } And if (a == 1) {x = 0; GlutPostRedisplay (); } And if (a == 2) {x = 0.8; GlutPostRedisplay (); } And if (a == 3) {x = 0; GlutPostRedisplay (); } Xn = 0; Eglene = 0; Lysenic = 0; Zmiana = 1; }} Zero trojakat (float x, float y, float angle) {glColor3f (q, w, e); GlPushMatrix (); GlTranslatef (X, Y, 0); Glottage (angle, 0, 0, 1); GlBegin (GL_POLYGON); Glitax 2f (0, 0.2); Glitax 2f (-0.2, -0.2); Glitax 2f (0.2, -0.2); GlEnd (); GlPopMatrix (); } Zero Prosevny () {a ++; If (a & gt; 3) {a = 0; }; If ((a == 1) || (a == 2)) {flaga = true; } And if ((a == 0) || (a == 3)) {flaga = false;} if (flaga == true) {xn + = .8; Eglene + = 360; Qn + = .1; Wn + = .7; N + = .3; } And if (flaga == wrong) {xn - = .8; Eglene + = 360; Qn + = .8; Wn + = .4; N + = .3; } Zmiana = 4; // wyzerowanie zliczania klatek timer callback (0); // wywołanie funkcji która będzie się okresowo powtarzać} void przesuwanie_w_lewo () // pierwsze przesuniecie o połowe jednostki {xn = 0; Xn - $ .8; Eglene + = 360; Qn - =. 9; Wn - = .7; N - = .3; Zmiana = 4; TimerCallback (0); // wywołanie funkcji która będzie się okresowo powtarzać} zero performance (zero) {/ * clear window * / glClear (GL_COLOR_BUFFER_BIT); Trojakat (x, y, angle); GlFlush (); If ((zmiana == 0) || (zmiana == 1) || (zmiana == 2)) {if (zmiana == 0) {przesuwanie_w_lewo (); } And if (zmiana == 1) {przesuwanie (); }}} Zero init () {/ * black color set clear color / glClearColor (0.0, 0.0, 0.0, 0.0); / * Set the set in white * / / * Set the original orthogonal view with clipping * / / * On the basis of the particle centered from 2 in the form of a / / * box / / * This is the default view and the statement deleted Can be * / glMatrixMode (GL_PROJECTION); GlLoadIdentity (); Glotho (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); GlMatrixMode (GL_MODELVIEW); GlLoadIdentity (); } Int main (int argc, char * argv []) {glutInit (and argc, argv); GlutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); GlutInitWindowSize (400, 400); GlutInitWindowPosition (0, 0); GlutCreateWindow ("trojkat"); GlutDisplayFunc (display); in this(); GlutMainLoop (); Return 0; }  


optimization - Varnish, custom subroutine with early exit -


I am new in varnish while editing our backend selector sub-routine, I started my initial return pattern in varnish configuration files Discovered

  sub select_backend {if (req.http.host ~ "tracking ... ..") {set req.backend = tracking; } If (req.http.host ~ "myapp1.domain.com") {if (req.url ~ "^ / Asur / route") {Error 403 "Forbidden"; } Set req.backend = app1; } If (req.http.host ~ "myapp2.domain.com") {set req.backend = app2; }} Sub vcl_recv {// select other content_back; }  

Changing the backend twice without proper return / exit statement is a risk (as the file makes it more complicated). Is it possible to use early return patterns to avoid this? If not, how can I save the if / elseif pattern without a bad pattern?

There is currently no good way to do this, as explained:

VCL's "return" statement gives VCL control of return to varnish from state engine. If you define your own function and call it with the default functions, typing "return (FU)" will not return your custom function to the default function, but will return the performance from VCL to varnish. This is why we say that VCL has terminated the statement with traditional return values.

There are such needs and recommended:

  if (req .http.host ~ "tracking ... ..") { Set req.backend = tracking; } Elsf (req.http.host ~ "myapp1.domain.com") {if (req.url ~ "^ / Asur / route") {Error 403 "Forbidden"; } Set req.backend = app1; } Elsf (req.http.host ~ "myapp2.domain.com") {set req.backend = app2; }  

If you place the pattern, then there should be no opportunity to set two times supported twice ... .. Alsif . If you have different if {} blocks, you can do this.


javascript - How to match date in string -


I'm trying to tease a date with a block of text as far as I know, the date is always 5 March 2015 (three-letter month, no major zero, four-digit yearday).

The block of text is slightly more variable, though. For the most part, this usually looks like this:

We understand that sometimes your travel plans change, we do not charge any change or cancellation fee. However, this property (hotel name) imposes the following penalties to its customers that we need to pass it on: Cancellations or 11:59 AM (GMT-5: 00) made after Eastern Time (US and Canada) Change) 1 night room on 10th March 2015 & amp; Tax Fines

This is my attempt ( val is a string containing variable):

 var valDate = val.match ("\\\" ) \\\) but (. *) Are "); Return Validate [1]; 

As you can see, I am at the end of time (which I believe is always there, regardless of EST / PST / etc) and

< Block>

And it was working very well .... Until one of my hotels did the following:

We Understand that sometimes your travel plans change, we do not charge any change or cancellation fee. However, this property (hotel name) imposes the following penalties to its customers that we need to cancel or change before 6:00 pm (GMT-5: 00) Eastern Time (US and Canada) March 15, 2015 1 night room and tax fines March 15, 2015 (6:00 pm (GMT-05: 00) Cancellations or changes made after the Eastern Time (US and Canada) 1 night room and tax fines

15 March 2015 are subject to 1 night room and The property does not give any refund to the show or initial checkouts.

; Taxes tax on March 15, 2015 at 6:00 pm (GMT-05: 00) Eastern Time (US and US Canada) or

which is far less than desirable, I think I understand why this is happening but try but I am not deciding it Additionally, my original mail is validly silly (hence the problem). ). I think that's probably a better way to launch the on ... I do not know how. Can

Does anyone help me? I will be very grateful at all!

A pattern that can match the description you provided:

(January | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Dec | Dec) \ [+0-9] | [1-2] [0-9] | 3 [0-1]), \ s + \ d {4}

Although I'm sure if you want to capture dates, you better To do this Search for a library such a library is probably less error prone, al -Separate the date patterns and perhaps make it easier to customize.

You can capture the group as a show:

  var r = / (Jan | Feb | Mar | Apr | May | Jun | July | Aug | September | October | November | Dec) \ s + ([0-9] | [1-2] [0-9] | 3 [0-1]) \ s + \ d {4} / g; Var t = "We understand that sometimes your travel plans change, we do not make any changes or cancel the charges. However, this property (hotel name) imposes a low penalty to its customers Passing on: Cancellations or changes are subject to 1 night room and tax penalty after 10 March 2015 at 11:59 am ((GMT-5: 00) Eastern Time (US and Canada)) Property No Show or Initial Check out No refund is given for the purpose. "; M = r.exec (t); While (m! = Null) {// m [0] do something with warning (i [0]); // example m = r.exec (t); }  

.


php - Codeigniter database issue on live server -


Hi guys, I really appreciate it if you can help me with this problem then I'm going to be a conductor I'm confronted with Everything works well on the local host but for unknown reasons, the active record does not work on the live server. I am not able to make any inquiries and am now trying to fix it. I have not found any errors related to the database connection and I am fully confident that all database configuration details are correct and all user privileges are also there.

Database.php

$ activ_group = 'default'; $ Active_record = TRUE; $ Db ['default'] ['hostname'] = '111.11.111.111'; $ Db ['default'] ['username'] = 'user name'; $ Db ['default'] ['password'] = 'password'; $ Db ['default'] ['database'] = 'database'; $ Db ['default'] ['dbdr'] = 'mysical'; $ Db ['default'] ['dbipfix'] = ''; $ Db ['default'] ['pconnect'] = true; $ Db ['default'] ['db_debug'] = Wrong; $ Db ['default'] ['cache_on'] = falls; $ Db ['default'] ['cachered'] = ''; $ Db ['default'] ['char_set'] = 'UTF8'; $ Db ['default'] ['dcc clan'] = 'utf 8_gjarac';; $ Db ['default'] ['swap_pre'] = '; $ Db ['default'] ['autoinit'] = true; $ Db ['default'] ['stricon'] = falls; Example: $ this- & gt; Db- & gt; Query ("trunket table test");

I know that I am using an active record correctly because it works well on the local host, just do not understand what the problem is on the server is its Thanks for the time and help of friends

If your database is hosted on the same server / CI If you have shared hosting as an application then you should be a host as a "localhost". Elsewhere is hosted so I'll check that CI hosting server has access to the DB

hosting server.

cluster computing - ElasticSearch UNASSIGNED indices fix without data loss -


For any reason that a group of indices became oblivious, I sent them without the cluster node I'm trying to use one of the following API calls, but the result is data loss, unfortunately (due to allow_primary):

  curl -XPOST 'localhost: 9200 / _cluster / repeat' 'beautiful' -d '{"command": [{"allocated": {"index": "sequence I have the following entries in "node-name", "shard": "0", "permission_primy": true, "node": "node-name" Elasticsearch.log:  
  [2015-03-16 11: 51: 12,181] [DEBUG] [action.search.type] [Cluster node] failed for all shard steps: [query_fetch] [2015-03-16 11: 51: 12,450] [DEBUG ] [Action.search.type] [cluster node] failed for all shard steps: [query_fetch] [2015-03-16 11: 51: 19,34 9] [DEBUG] [action.bulk] [cluster node] Supervisor: Timed out time setting from the cluster service [1 m], starting from [1 m] [2015-03-16 11: 51: 20,057] [DEBUG] [action.bulk] Stir node] Supervisor: Timeout reported timeout setting cluster service [1m], starting from the time [1m]  

would appreciate any help.


generics - Java unchecked conversion -


मेरे पास कोड की निम्न पंक्ति है

  this.html विशेषचरों = this.getSpecialCharMap () ;  

जहां

  निजी हैशमैप & lt; स्ट्रिंग, स्ट्रिंग & gt; htmlspecialchars;  

लेकिन मुझे एक अनचेक रूपांतरण के बारे में एक चेतावनी मिलती है। मैं इस चेतावनी को कैसे रोकूं?

आप इसे प्राप्त कर रहे हैं क्योंकि getSpecialCharMap () एक ऑब्जेक्ट लौट रहा है जिसका प्रकार को कंपाइलर द्वारा हाशमैप के लिए सत्यापित नहीं किया जा सकता & lt; स्ट्रिंग, स्ट्रिंग> आगे बढ़ो और getSpecialCharMap के लिए प्रोटोटाइप प्रदान करें।


ASP.NET C# CheckBox does not fire CheckedChanged event when unchecking -


मेरे पास पुनरावर्तक है

  & lt; asp: repeater ID = "rptResult" runat = " सर्वर "& gt; & LT; ItemTemplate & gt; & LT; टीआर & gt; & LT; टीडी & gt; & Lt; asp: चेक बॉक्स आईडी = "chkShipStatus" runat = "server" EnableViewState = "true" व्यूस्टेटमोड = "सक्षम" ऑटोपोस्टबैक = "ट्रू" कमांडनाम = '& lt;% # DataBinder.Eval (कंटेनर.डेटाइटम, "सीटी")% & gt; ' ऑन-चेक किए गए बदलाव = "chkShipStatus_CheckedChanged" चेक किया गया = '& lt;% # Convert.ToBoolean (Eval ("SHIPPED"))? सच: गलत% & gt; ' / & Gt; & Lt; / टीडी & gt; & Lt; / टीआर & gt; & Lt; / ItemTemplate & gt; & Lt; / एएसपी: पुनरावर्तक & gt;  

और

और page_load से डेटा कॉल करें

  संरक्षित शून्य पृष्ठ_लोड (ऑब्जेक्ट प्रेषक, इवेंटएरग्स ई) {if (! IsPostBack) {डाटाटाबल डीटी = एपी। गेटडाटाटेबल (एसक्यूएल); RptResult.DataSource = dt; rptResult.DataBind (); } // वहां जाकर समाप्त होता है जब अनचेक}  

और यहां मेरा चेक-चेंड इवेंट है, केवल जब मैं फ़ायर नहीं करता जब मैंने इसे अनचेक नहीं किया था, तो यह पेज_लोड पर जाता है (इनसाइक्लिक नहीं है postback)

  संरक्षित शून्य chkShipStatus_CheckedChanged (ऑब्जेक्ट प्रेषक, EventArgs ई) {var सीबी = (चेकबॉक्स) प्रेषक; // वहां जाइए जब मैं चेक करता हूँ (cb.Checked == true) {// वहां जा रहा है जब मुझे चेक किया जाता है} और {// कभी यहां नहीं जाते हैं जब मैं अनचेक करता हूं}}  

चेकबॉक्स कोई commandName संपत्ति नहीं है, इसलिए इसे हटा दें

  & lt; asp: चेक बॉक्स आईडी = "chkShipStatus" runat = "server" EnableViewState = "true" व्यूस्टेटमोड = "सक्षम" ऑटोपोस्टबैक = "ट्रू" ऑन चेक्ड चेंजेड = "chkShipStatus_CheckedChanged" चेक किया गया '' & lt;% # Convert.ToBoolean Eval ("SHIPPED"))? सच: गलत% & gt; ' / & Gt;  

यदि आप यह जानना चाहते हैं कि आप किस चेकबॉक्स में थे, तो आप NamingContainer का उपयोग कर सकते हैं। फिर repeaterItem.FindControl का उपयोग उस पुनरावर्तक आईटम में एक और नियंत्रण पाने के लिए करें। उदाहरण के लिए, आप रिकॉर्ड की आईडी को स्टोर करने के लिए HiddenField का उपयोग कर सकते हैं।

  संरक्षित शून्य chkShipStatus_CheckedChanged (ऑब्जेक्ट प्रेषक, EventArgs ई) {var सीबी = (चेकबॉक्स) प्रेषक; पुनरावर्तक आईटम = = (पुनरावर्तक आईटीएम) सीबी। नेमिंग कॉन्टैनेयर हिडनफिल्ड छुपाएंड = (हिल्डफिल्ड) आइटम। फ़ंड कंट्रोल ("छुपाएंड"); स्ट्रिंग id = hiddenID.Value; // ...}  

javascript - Sharing data with between Controllers with a Factory, AngularJS -



javascript - Sharing data with between Controllers with a Factory, AngularJS -

i want share info between controllers:

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.4/angular.min.js"></script> <script> var myapp = angular.module('myapp',[]); myapp.factory('data', function(){ homecoming {show: true, text: "hello"}; }); myapp.controller('ctrl1', ['$scope', 'data', function($scope, data) { $scope.data = data; }]); myapp.controller('ctrl2', ['$scope', 'data', function($scope, data) { $scope.click = function(){ info = {text:"hello2", show:true}; } }]); </script> <body ng-app='myapp'> <div style="background-color:red;margin-top:30px;" ng-controller="ctrl1"> {{data.text}} </div> <div style="background-color:yellow;margin-top:30px;" ng-click="click()" ng-controller="ctrl2"> click alter info </div> </body>

demo http://plnkr.co/edit/qhuwlyjbqdvl20fl7eeu?p=preview . doesn't work, if write

data.text = 'hello2'; data.show = true;

it works perfectly. demo http://plnkr.co/edit/xktlulbu0dqpusincryc?p=preview

it handy updating model specifying json, how can it?

by doing data = {text:"hello2", show:true}; overwrite initial data object, results broken reference. that's why can't assign new object. can this:

myapp.factory('data', function(){ homecoming { prop: {show: true, text: "hello"} }; });

and later:

data.prop = {text: "hello2", show: true};

javascript angularjs

jquery - Failed to load resource: the server responded with a status of 404 (Not Found) -



jquery - Failed to load resource: the server responded with a status of 404 (Not Found) -

im using contoso university tutorial , im trying modify tutorial:

https://www.youtube.com/watch?v=b59skvlroyc

when im done see error in browser inspector (f12)

https://www.dropbox.com/s/wy1c6ocxxbke1f2/error.jpg?dl=0

failed load resource: server responded status of 404 (not found)

could explain problem?

controller:

public partialviewresult top3() { list<student> model = students.orderbydescending(s => s.enrollments.select(s => s.course.credits)).take(3).tolist(); homecoming partialview("_student", model); }

index view:

@model pagedlist.ipagedlist<contosouniversity.models.student> @using pagedlist.mvc; <link href="~/content/pagedlist.css" rel="stylesheet" type="text/css" /> <script src="../scripts/jquery-1.8.0.min.js"></script> <script src="~/scripts/jquery.unobtrusive-ajax.min.js"></script> @{ viewbag.title = "students"; } <h2>students</h2> <p> @html.actionlink("create new", "create") </p> @using (html.beginform("index", "student", formmethod.get)) { @html.antiforgerytoken() @html.validationsummary(true) <p> find name: @html.textbox("searchstring", viewbag.currentfilter string) enrollment: <input type="submit" value="filter" /> </p> } <table class="table"> <tr> <th> @html.actionlink("last name", "index", new { sortorder = viewbag.namesortparm }) </th> <th> first name </th> <th> @html.actionlink("enrollment date", "index", new { sortorder = viewbag.datesortparm }) </th> <th> date of birth </th> <th> courses </th> <th> credits </th> <th></th> </tr> @foreach (var item in model) { <tr> <td> @html.displayfor(modelitem => item.lastname) </td> <td> @html.displayfor(modelitem => item.firstmidname) </td> <td> @html.displayfor(modelitem => item.enrollmentdate) </td> <td> @html.displayfor(modelitem => item.dateofbirth) </td> <td> @string.join(",", item.enrollments.select(e => e.course.title)) </td> <td> @item.enrollments.sum(e => e.course.credits) </td> <td> @html.actionlink("edit", "edit", new { id=item.id }) | @html.actionlink("details", "details", new { id=item.id }) | @html.actionlink("delete", "delete", new { id=item.id }) </td> </tr> } </table> <br /> @ajax.actionlink("top3", "top3", new ajaxoptions() { httpmethod = "get", updatetargetid = "divstudents", insertionmode = insertionmode.replace }) <span style="color:blue"></span> <div id="divstudents"> </div> page @(model.pagecount < model.pagenumber ? 0 : model.pagenumber) of @model.pagecount @html.pagedlistpager(model, page => url.action("index", new { page, sortorder = viewbag.currentsort, currentfilter = viewbag.currentfilter }))

partial view:

@model ienumerable<contosouniversity.models.student> <h3>top 3 student</h3> <table style="border: 1px solid black; background-color:silver"> @foreach (var item in model) { <tr> <td> @html.displayfor(modelitem => item.lastname) </td> <td> @html.displayfor(modelitem => item.firstmidname) </td> <td> @html.displayfor(modelitem => item.enrollmentdate) </td> <td> @html.displayfor(modelitem => item.dateofbirth) </td> <td> @string.join(",", item.enrollments.select(e => e.course.title)) </td> <td> @item.enrollments.sum(e => e.course.credits) </td> </tr> } </table>

jquery ajax asp.net-mvc-4