another

jquery (ajax) redirect to another domain

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the jquery json request in the following format: JSON request: $.getJSON('http://xyz.com',function(result) {}); If the request fails(server not responds), how do i redirect to another domain. for example " http://zxy.com ".(we maintaining the same code in another server) 回答1: Did you try this? function addImage(item) { $("<img/>").attr("src", item.media.m).appendTo("#images"); } var jqxhr = $.getJSON("http://xyz.com",function(data) { $.each(data.items, function(i,item){ //sample addImage(item); }) .error(function() { var jqxhrFailover

Accessing form members from another class

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The point is to notify the user using the memo when a packet is received/sent in a TCP Client. The old code was extra dumb,I used a Timer that used to add text in the memo since the Timer has access to the form members,lol. The old code: //Memo.Text += txt + "\n"; I played with it today,this is what I've done In Form1's class public string TextValue { get { return Memo.Text; } set { this.Memo.Text += value + "\n"; } } I call the code like that: Form1 myForm = new Form1(); myForm.TextValue = "test asdasd"; The memo modifiers are private ,but

Multiply newly entered row with another column value and find Total Sum in SQL

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have 4 tables here, I need to multiply newly entered row value in a table with another row and find the total sum using CustomerId : CustomerTable : CustomerId Name EmailId ------------------------- 1 Paul r@r.com 2 John J@j.com LoyaltyPointTable : LoyaltyPointsId LoyaltyType Points --------------------------------------- 1 Registration 10 2 Loginstatus 1 3 Downloading 10 4 Redemming 1 5 Sharing 20 6 Refer 10 LoyaltyDetailsTable : LoyaltyDetailsId LoyaltyPointsId CustomerId Dates ------------------------------------------------- 1 1 1 2015

How to split a list by another list in Scala

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am new to Scala and I need a solution to my problem. Imagine I have these lists: val list1 = List(1,2,3,4,5,6,7,8,9,10,11) val list2 = List(6,5) And my desire is to split the first list in a List of Lists using list2 to map it. So the result would be something like this: val result = List(List(1,2,3,4,5,6), List(7,8,9,10,11)) If my list2 was like this: val list2 = List(4,4,3) The result would then be: val result = List(List(1,2,3,4),List(5,6,7,8),List(9,10,11)) What is the best way to do this? 回答1: You can use a combination of scanLeft and

Jumping from one firmware to another in MCU internal FLASH

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am currently working on a bootloader firmware application targeted to STM32F030C8. I specified in my scatter file that the bootloader app will occupy main memory location 0x08000000 to 0x08002FFF (sector 0 to sector 2). I also wrote a main firmware application that is stored from 0x08003000 to 0x0800C800. After downloading both firmware to the MCU internal FLASH, I lauched the main app from the bootloader using the code below: /************************************************************//** * \brief Start the main application if available

ArrayList contains another ArrayList

匿名 (未验证) 提交于 2019-12-03 02:28:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There is probably a simple one-liner that I am just not finding here, but this is my question: How to check if an ArrayList contains all of the objects in another ArrayList. I am looking (if it exists) for something along the lines of: //INCORRECT EXAMPLE: if(one.contains(two)) { return true; } else { return false; } For example: ArrayList one = {1, 2, 3, 4, 5} ArrayList two = {1, 2, 3} --> True ArrayList two = {} --> True ArrayList two = {1, 2, 3, 4, 5} --> True ArrayList two = {1, 5, 2} --> True ArrayList two = {1, 7, 4} --> False

Remove file locked by another process

匿名 (未验证) 提交于 2019-12-03 02:28:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: While testing an application stability I am trying to remove/corrupt database used by the application. OS is Windows, file system is NTFS, tests language is C++. What I need is to paste anything into the database file or remove it. But it is locked by the tested application during the run. So maybe someone faced this case before and you can give me/us an example on possible ways to bypass this lock in test code? Theory or source - I am appreciated for any kind of help. 回答1: You'll have to close the handle that your application has to the

Transaction context in use by another session

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a table called MyTable on which I have defined a trigger, like so: CREATE TRIGGER dbo.trg_Ins_MyTable ON dbo.MyTable FOR INSERT AS BEGIN SET NOCOUNT ON; insert SomeLinkedSrv.Catalog.dbo.OtherTable (MyTableId, IsProcessing, ModifiedOn) values (-1, 0, GETUTCDATE()) END GO Whenever I try to insert a row in MyTable , I get this error message: Msg 3910, Level 16, State 2, Line 1 Transaction context in use by another session. I have SomeLinkedSrv properly defined as a linked server (for example, select * from SomeLinkedSrv.Catalog.dbo

Replace one substring for another string in shell script

匿名 (未验证) 提交于 2019-12-03 02:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have "I love Suzi and Marry" and I want to change "Suzi" to "Sara". #!/bin/bash firstString = "I love Suzi and Marry" secondString = "Sara" # do something... The result must be like this: firstString = "I love Sara and Marry" 回答1: To replace the first occurrence of a pattern with a given string, use ${ parameter / pattern / string } : #!/bin/bash firstString = "I love Suzi and Marry" secondString = "Sara" echo "${firstString/Suzi/$secondString}" # prints 'I love Sara and Marry' To replace all occurrences, use ${ parameter //

Open a Modal from another modal and close the first (launching) modal

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Bootstrap Modal Window plugin its work fine but i would like to open another model window when i click next and close first one. how can i do it? $('[data-toggle="modal"]').click(function(e) { e.preventDefault(); var url = $(this).attr('href'); if (url.indexOf('#') == 0) { $(url).modal('open'); } else { $.get(url, function(data) { $(data).modal(); }).success(function() { $('input:text:visible:first').focus(); }); } }); <a href="next.html" data-toggle="modal">Add Record</a> next.html File Code <div class="modal fade" id="compose