Fetching data based on common keys using core data re

Uncategorized
Question: I am actually working on a project where there are two entities IDUSUNP and WOUNI with following attributes. IDUSUNP:userid,permission,assetid WOUNI:uniqueid,hours,duration,name,description. Data for table is getting inserted from other service and data for WOUNI is getting inserted from some other service.Now,I can't pass data of one entity to other other entity but when I enter a userid , I have to fetch WOUNI records from IDUSUNP on the basis of common key .In the above entities ,assetid and uniqueid are common key.Is,it possible to achieve this just by using the common key.I have tried but this returns null result. Following are the codes that I am using: //IDUSUNPViewController - (IBAction)save:(id)sender { NSManagedObjectContext *context = [self managedObjectContext]; NSManagedObject *idusunp = [NSEntityDescription insertNewObjectForEntityForName:@"IDUSUNP" inManagedObjectContext:context]; [idusunp setValue:self.assetidTextField.text forKey:@"assetid"]; [idusunp setValue:self.userIdTextField.text forKey:@"userid"]; [idusunp setValue:self.permissionTextField.text…
Read More

no value of textbox captured on first attempt by jquery

Uncategorized
Question: I've this simple code When I run this in browser, provide value to the textbox and click on button it alerts blank. when clicked next time shows the value. what could be the issue.? 1st Attempt. 2nd Attempt. Answer: That's because you are reading the value outside the event handler. Essentially you want to read the value of the textbox when the user clicks on the submit button, not before it. It could be written as follows:$(document).ready(function() { // This code is executed when the page loads. $("#btnsubmit").click(function() { // This code is executed when the user clicks on the submit button. var username = $("#txtusername").val(); alert(username); }); }) Read more
Read More

filter unique properties from array of objects with unique values if existing then override the value

Uncategorized
Question: I am trying to iterate array of objects with different properties. where I am adding objects dynamically and want to check whether the property of the object is exist in the array then only override the value else add it to the array. For e.x. var arr = [ {"value":"abc"}, {"type":"def"}, {"status":"ghi"}, {"value":"xyz"} ] expected result:arr = [ {"value":"xyz"}, {"type":"def"}, {"status":"ghi"} ] What I am trying so far is not working. Here is my code:var arr = [ {"value":"abc"}, {"type":"def"}, {"status":"ghi"}, {"value":"abc"} ] var obj={}; var key1 = "type", value="xyz"; obj[key1] = value; var newarr = arr.filter(function(entry,i) { if (!entry.hasOwnProperty(key1)) { return true; } }); newarr.push(obj); Please note, the obj will be dynamic so my code is working fine for first time when the property of key1 doesn't change.…
Read More

Sending national symbols from Android to C# Windows through Socket

Uncategorized
Question: There is an XML file, containing some national symbols data. It is the SMS messages and their bodies. I use Socket connection to transfer that xml file to Windows PC, where C# code receives it. How to pack and send the data in such case..? DataOutputStream outToClient = outToClient = new DataOutputStream (inSock.getOutputStream ( )); outToClient.writeBytes(Data2Send); //
Read More

Empty space between tab and content

Uncategorized
Question: I want to display the contents of each tab. But there is an empty space. There is no free space in the first tab but it exists in other tabs. I want to remove this gap How to fix this problem? (Please do not suggest any Java Script code.) The following figure shows this problem There is an empty space between the tab and the content .tab-caption:nth-of-type(1) { background-color: #FFAAAA; } .tab-caption:nth-of-type(2) { background-color: #AAFFAA; } .tab-caption:nth-of-type(3) { background-color: #AAAAFF; } .tab-content:nth-of-type(1) { background-color: #FFAAAA; } .tab-content:nth-of-type(2) { background-color: #AAFFAA; } .tab-content:nth-of-type(3) { background-color: #AAAAFF; } .tab-status { display: none; } .tab-status ~ .tab-caption-container { display: flex; } .tab-status ~ .tab-caption-container > .tab-caption { opacity: 0.4; cursor: pointer; } .tab-status:nth-of-type(1):checked ~ .tab-caption-container > .tab-caption:nth-of-type(1) { opacity: 1; } .tab-status:nth-of-type(2):checked…
Read More

Is there a way to slide one big “slide” using swiper.js?

Uncategorized
Question: I'm trying to find a way to slide my data within a container without having to use the default horizotal scrollbar. So I tried using swiper.js. It works - kind of, but the problem is that I can't freely slide it back and forth without the "slide" automatically sliding back. I made a fiddle here to test. Here is the JS code I'm using:var swiper = new Swiper('.swiper-container', { freeMode: true, freeModeSticky: false, grabCursor: true }); Is it possible using swipe.js to freely moving the content back and fort? If no, is there a better way to do this? Answer: Read more
Read More