Wednesday, April 11, 2012

android remove a view from a dialog?

How would I remove a view from this dialog? I know I can remove a view from a LinearLayout.removeView(id)( LinearLayout.removeView(View) ), so if someone could tell me how to get (LinearLayout) R.layout.database_creation_form, that would be nice too. I am using Android-SDK V7



Java Code:



@Override
protected DialogInterface onCreateDialog(int id){
LayoutInflater factory = LayoutInflater.from(getBaseContext());
final View textEntryView = factory.inflate(R.layout.database_creation_form, null);
setDialogViewAttributes(textEntryView);
final EditText editText = (EditText)textEntryView.findViewById(R.id.create_form_db_name_et2);
final Spinner spinner = (Spinner)textEntryView.findViewById(R.id.create_form_type_sp);
return new AlertDialog.Builder(FileBase.this)
.setTitle(R.string.create_database_string)
.setView(textEntryView)
.show();
}


XML for database_creation_form:



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" android:paddingTop="25px">


<TextView
android:id="@+id/create_form_db_name_tv"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/create_form_db_name"
android:textAppearance="?android:attr/textAppearanceLarge" android:paddingBottom="25px"/>

<EditText
android:id="@+id/create_form_db_name_et2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:inputType="text">

<requestFocus />
</EditText>


<TextView
android:id="@+id/create_form_type_tv"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/create_form_type"
android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="center"/>

<Spinner
android:id="@+id/create_form_type_sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>




How does kAudioUnitSubType_NBandEQ work? Or equalizing using DSP formulas with Novocaine?

I'm trying to make a 10-band equalizer and the kAudioUnitSubType_NBandEQ audio unit seems the way to go, but Apple's documentation doesn't cover how to set/configure it.



I've already connected the nodes but it errors out when I try to connect the EQNode with the iONode (output): https://gist.github.com/2295463



How do I turn the effect into a working 10-band equalizer?



Update:
A working DSP formula with Novocaine is also a solution, any ideas! Those DSP formulas are quite complicated.



Update2:
I prefer a working DSP formula with Novocaine since that'd be much cleaner/smaller than programming Audio Nodes.



Update3:
"The Multitype EQ unit(of subtype kAudioUnitSubType_NBandEQ) provides an equalizer that can be configured as any one of the types described in "Mutitype EQ Unit Filter Types" (page 68)."
Source: http://developer.apple.com/library/ios/DOCUMENTATION/AudioUnit/Reference/AudioUnit_Framework/AudioUnit_Framework.pdf
But still no example.





Dynamic menu contribution with key bindings

I've a question. I have a dynamic menu contribution (class extending the ContributionItem). But I cannot find how to connect these items with key bindings.



The main problem is, that the plugin is actually quite easy. It loads menu from XML file. Practically it is a horror, because there is just few tutorials about dynamic menus. Almost every tutorial uses plugin.xml. But I cannot do it this way. I need to load items from a XML file depending on the workspace choosen. The file contains menu structure including key bindigs. That's my problem. I've never found how to bind keys with commands dynamically.





need help to rewrite url

Hi i am creating an API using JSON. I using a website with url "http://www.domain.com/api/". I have writtin all API with respect to their functions in a single handler file and accessing this handler file from an index file (for testing purpose from local server) such that the url is "http://www.domain.com/api/index.php" and i want this url to be "http://www.domain.com/api/".



My variable used for JSON is:



data = '{"appId":"'+appId+'", 
"m":"login",
"email":"abc@yahoo.com",
"pwd":"abcd",
"deviceToken": "111111111"}';


I am sending this using ajax from index file to fetch function defined in handler file.



I heard that we can do this using rewriting url. Can anyone tell me How to rewrite url for this and how to fetch these variables. "http://www.domain.com/api/". this function name is 'm' variable which is used to fetch respected function from handler file.



Can anyone help? I am new with JSON (though most of the work is complete, but i am unable to meet the url requirement)





Skip and copy Function assistance

New programmer here. I need some help. So basically what im trying to do here is to copy certain parts of 1 string stored in an array into 3 different arrays by ignoring the "," in the string. I'll show you the code to be more clear.



#include<stdio.h>
#include<string.h>

main()
{
char temp[50];
char temp1[50],temp2[50],temp3[50];
int i,m;
strcpy(temp,"abc,123,rio");
for(i=0;i<strlen(temp);i++)
{
//printf("%c\n",temp[i]);
if (temp[i]==',')
temp[i]=='';
else
temp1[i]=temp[i];
}
printf("%s\n",temp1);
return 0;
}


Now the problem comes in at the part where it says "temp[i]==''"
I know that line is wrong. But i need some help there. I want to be able to skip the "," and move on to copy 123 in temp2 and rio in temp 3. So far i was only able to copy abc into temp1. I don't know exactly how to "Skip and copy" the rest. Please help fast ! :]





MySQL select procedure

I have little weird issue here. So, I have these two tables. For example:



tbl1            tbl2

col1 col1 col2
---- ---- ----
BET BET 0
EMK EMK 1
BET EMK 3
EMK BET 4
BET BET 5
ANC


What I would like to do is to have a procedure (for now a select query will do) that selects data from tbl1 and compares it to tbl2 and return the following result:



col1  col2
---- ----
BET 0
EMK 1
BET null
EMK 3
BET 4
ANC 5


I have no idea how to even begin this... Is there any way to, maybe use an if..else within a select statement?... Please, help! Thank you in advance!



EDIT



I'm sorry for not being very clear.
I need it to to show null for an item in the first table that does not follow the order of the second table.
Here we have BET in both tbl1 and tbl2, therefore col2 should be 0,
next, EMK in both -> col2 - 1
next, BET is not in tbl2 (it does not go right after row 2 with value EMK) - set col2 to null.
next, EMK in tbl1, there is also EMK in tbl2, that goes after previous EMK, set col2 to 3
next, BET in tbl1 and tbl2, set col2 - 4
next, ANC in both tables, col2 - 5.



I apologize for this gibberish, but this the best I can do to explain this logic...





executing csv copy command from remote machine with jdbc

How to create stdin object to pass as a parameter to copy command for csv upload into db table and execute with jdbc api



Example that i tried



DataInputStream in = new DataInputStream(new BufferedInputStream(
new FileInputStream("C:/Documents and Settings/517037/Desktop/new.csv")));

copy temp123 from "+in.read()+" using delimiters '|'


But here i am getting error.



org.postgresql.util.PSQLException: ERROR: syntax error at or near "48"
Position: 19



can any one help me out in this





Eclipse PHP IDE


Similar title but different question to

     Eclipse PHP IDE - custom auto complete tags







Possible duplicate of

     Getting started with PHP in Eclipse IDE




Doe's anyone know a tool / IDE / plugin in Eclipse for PHP development?



I already try the ZEND PDT but it seems that it has a bug and it doesn't install in my eclipse. I even follow this workaround in installing it but it still doesn't work.



My Eclipse verions is 4.1.2, OS is in Windows XP SP3.



The previous questions doesn't seems to have a solid answer. Please help. Thanks in advance.





org.xml.sax.SAXException: Processing instructions are not allowed within SO

I am using one web service which was working earlier but suddenly it start giving this error. can any one please help me why this is happening.



AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages
at org.apache.axis.encoding.DeserializationContext.startDTD(DeserializationContext.java:1161)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.doctypeDecl(AbstractSAXParser.java:334)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.doctypeDecl(XMLDTDValidator.java:746)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.scanDoctypeDecl(XMLDocumentScannerImpl.java:712)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:968)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.focuspad.webapp.payment.paymentGateway.PxConfinedTest.PxOrderSoap_BindingStub.purchaseCC(PxOrderSoap_BindingStub.java:612)
at com.focuspad.webapp.payment.service.impl.PaymentAPIManagerImpl.purchaseCC(PaymentAPIManagerImpl.java:132)
at com.focuspad.webapp.payment.controller.PaymentController.getPayExUserAgreementProfile(PaymentController.java:57)
at com.focuspad.webapp.controller.SignupController.createAccount(SignupController.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:139)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:59)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at com.focuspad.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:73)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)





Accessing Session in Domain Object

We use event sourcing in our app and also have a strict need to track the user who initiated changes to many of our objects. Currently we have code like this



class Order { 
setNameBy(newname, User user) {
applyChange(new OrderRenamed(user.id, newname));
}
:
}


Since most of our methods are like this and all of them are called like this



setNameBy("a new name", SessionContext.currentUser)


we where contemplating accessing the SessionContext inside the domain object. i.e:



setNameBy(newname, User user) {
applyChange(new OrderRenamed(user.id, newname));
}


becomes



setName(newname) {
applyChange(new OrderRenamed(SessionContext.currenUser.id, newname));
}


I personally prefer the later method signature as it seams more natural on the other hand it feels a bit messy to access the SessionContext inside the Domain object.



So how do you best handle Session data like this in DDD/CQRS apps ?. Is it OK to access the SessionContext in the Domain objects or should I use other methods like event enrichment to add this information to the events emitted from the domain ?.





Can I develop a 2D Platform Game for Android using Eclipse?

I have just started to get into android development and would like to ask for some help. I understand the basics of android development, and understand things such as Collision Detection. I would like to make a 2D Platform Game similar in structure to Super Mario Bros.



I know that it is possible to make platform games using the Unity Engine. People usually prefer the Unity Engine, but they say that an intermediate skill of coding is required.



Please could you tell me if and how I could develop the game using only Eclipse?



Should I use both Eclipse and Unity to develop the app?





How to get Absolute Path of Jekyll Bootstrap Page

I tried to add a facebook share link to a jekyll bootstrap page, however when adding the href that FB will use in the share I used {{ HOME_PATH }}. This turns out to be the relative path of /, however (which FB does not understand). Does anybody know how to get the absolute path without having to hard-code it?



Code that gives a /



<a name="fb_share" type="button"
share_url="{{ HOME_PATH }}">Share this event on Facebook</a>




How to store information

Hello I was wondering on how to store username and passwords (which will include some form of payment) for a website. I know it involves MySQL, PHP and databases. But could anyone link me to a good example/tutorial on how to store this information? Also do you think using a windowsazure is a good idea?



Edit:
How do I create a secure database that will hold the information?





Why there is no concept of "const-correctness" for class's static member functions?

Use case:



class A {
static int s_common;
public:
static int getCommon () const { s_common; };
};


Typically this results in an error as:




error: static member function 'static int A::getCommon()' cannot have
cv-qualifier




This is because constness applies only to the object pointed by this, which is not present in a static member function.



However had it been allowed, the static member function's "const"ness could have been easily related to the static data members.

Why this feature is not present in C++; any logical reason behind it ?





Capturing Mouse pointer shape change event in MFC

I am writing a windows application which requires mouse pointer shape change notification. I have searched thoroughly but could not find a satisfactory solution. I want to receive a notification for cursor shape change as well as the type of cursor to which it has changed.



From the search I came to know that I will have to install a hook in every process and capture WM_SETCURSOR event but capturing this message does not give me full information. So please guide me if anybody can help





Converting input numerical string in C

The question is to write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English. so, if a user types 932, the program should display 'nine three two'..



My algorithm is to reverse the number first so that 932 becomes 239. Now I extract the last digit using mod operator and print. Next I divide the number by 10, then I extract the last digit again and so on...



Is there any other algorithm (shorter and efficient) possible?



It is possible to extract the last digit of an integer. Is it possible to extract the first digit and so on?





Mount nfs drive in windows 7 issue

I have a linux server and an windows 7 home 64bit laptop.
I need to mount a folder under the linux as a drive letter on the laptop, I understand that windows 7 has a native nfs client that you can activate from programs and features the issue is that I don't have this option as shown in the tutorials.
Because of that the command promt is giving me an error when I try to use the "mount" command, I tried powershell but had no luck. Any suggestions? Has anybody had this issues(not having the services for nfs in windows features) what solution should I fallow?
Thank you for any help!
Alex





How to add WCF templates to Visual Studio Express?

I am working through the book Learning WCF by Michele Bustamante, and trying to do it using Visual Studio C# Express 2008. The instructions say to use WCF project and item templates, which are not included with VS C# Express. There are templates for these types included with Visual Studio Web Developer Express, and I've tried to copy them over into the right directories for VS C# Express to find, but the IDE doesn't find them. Is there some registration process? Or config file somewhere?





MaskedTextBoxt "calculator" input method

I have masked text box. Mask is simple "0000". But, I need my text box having cursor always docked to right, and my text shifting to left when I typing. Just like in ordinary calculator.



 this.TaskInput.Location = new System.Drawing.Point(184, 54);
this.TaskInput.Mask = "000";
this.TaskInput.Name = "TaskInput";
this.TaskInput.PromptChar = '0';
this.TaskInput.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.TaskInput.Size = new System.Drawing.Size(190, 20);
this.TaskInput.TabIndex = 2;


Regards, Dmitry.





Android application with java activities and native engine

Is it good idea to have application engine written in c++ and user interface with java?



update



Application will show maps.engine in background will download and cache maps.
I'm affraid about system stability because native part wouldn't be guarded in dalvik mashina and exception in native part can crash my device.





How to decode route points from the JSON Output Data?

I am new in the ios field, Now i am trying to implement MKMapView Based iPhone Application. From the Google Map Web web service i Fetch the Data in JSON Output Format.



- (void)update {

self.responseData=[NSMutableData data];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://maps.googleapis.com/maps/api/directions/json?origin=Ernakulam&destination=Kanyakumari&mode=driving&sensor=false"]];
[[NSURLConnection alloc] initWithRequest:request delegate:self];
}
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{
[self.responseData setLength:0];
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
[self.responseData appendData:data];
}
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{
[connection release];
self.responseData =nil;
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
NSLog(@"connection established");
[connection release];
NSString *responseString=[[NSString alloc]initWithData:self.responseData encoding:NSUTF8StringEncoding];
self.responseData=nil;
NSLog(@" OUTPUT JSON DATA^^^^^^^^^^^^^^^^%@",responseString);


}


I got the out put has in the JSON Format. Now i want to draw route between this two location. sow how can i separate all the latitude and Longitude points from the JSON out put Data.





How to sum column of type string in footer?

A.O.A,



I have a report that shows Overtime of an employee of a particular month.
I want to calculate the total number of overtime in footer



This is how i'm calculating overtime




  • "tout" is EmployeeLeavingtime

  • "otLimint" is the Timelimit (like if ShiftEndTime is 6:00PM then overtime will be
    calculated if tout is > 6:30)

  • shiftendTime is (6:00PM)



    string timeOut = r["TimeOut"].ToString();
    Time tOUT = new Time(timeOut);
    Time OtLimit = new Time(18, 30, 00);

    if (tOUT > OtLimit)
    {
    DateTime ShiftendTime = Convert.ToDateTime(r["ShiftEndTime"].ToString());
    DateTime Out = Convert.ToDateTime(r["TimeOut"].ToString());
    TimeSpan span = Out.Subtract(ShiftendTime);
    r["OTHrs"] = span.ToString().Replace("-","");
    }



im using



Sum(Fields!TotalLH.Value) in Report footer expression


but this is not showing Total at runtime





SQL query from www.db-class.com

I'm solving www.db-class.com exercises. Even though it's late the questions are still interesting. I stumbled upon last task in extras and cannot figure out the solution.



The SQL scheme is as follows:




create table Movie(mID int, title text, year int, director text);



create table Reviewer(rID int, name text);



create table Rating(rID int, mID int, stars int, ratingDate date);




The question is the following:




Q12 For each director, return the director's name together with the
title(s) of the movie(s) they directed that received the highest
rating among all of their movies, and the value of that rating.
Ignore movies whose director is NULL.




Thank you.





Chrome border-radius is ignored when child element uses relative positioning

I am working on a project that utilizes a circular div laying over images to create a sort of looking glass effect, where you can drag an image around within the circular div.



The markup for the app is as follows:



<div id="LookingGlass" class="looking-glass" style="margin:0 auto;">
<div class="looking-glass-images">
<img src="/wp-content/uploads/2011/11/CCDS_Ext_008a-copy.jpg" width="1250" height="980" />
<img src="wp-content/uploads/2011/11/CCDS_Ext_011.jpg" width="967" height="1250" />
<img src="wp-content/uploads/2011/11/CCDS_Ext_012.jpg" width="1250" height="962" />
<img src="wp-content/uploads/2011/11/CCDS_Int_005.jpg" width="912" height="1250" />
<img src="wp-content/uploads/2011/11/CCDS_Int_008.jpg" width="1250" height="833" />
</div>
<ul class="looking-glass-nav"></ul>
</div>


jQuery autopopulates the nav object with numbers that fade out the current images and fade in whichever is clicked.



Here is the Sass code for the object as well



@mixin border-radius($size)
border-radius: $size
-webkit-border-radius: $size
-moz-border-radius: $size

.looking-glass
display: block
height: 100%

.looking-glass-nav
li
display: inline
padding: 5px

.looking-glass-images
overflow: hidden
display: block
height: 500px
width: 500px
@include border-radius(50%)

img
-webkit-user-select: none
-moz-user-select: none
user-select: none
img.active
display: block
img.inactive
display: none


When I impose the draggable effect on the images they are given a relative position style and for some reason that stops the div containing the images from being roundable. Is this a bug in Chrome or is there something I am doing wrong here?





onchange fuction

I am trying to create a function to run when a select option is changed. In my select menu i have;



    <form id="frame">
<select id="frame_color" onchange="fChange()">
<option value="0">Polished Black</option>
<option value="1">Grey</option>
</select>
</form>


The only thing that I want the fChange() function to do is update the variable that is holding the options value with the onchange value. So, the variable in the function fChange starts off by holding the value "0", and when I change it to "Grey" I want the variable to update to "1". I am having a hard time figuring out how to code the function properly. Any suggestions?





CDBStore as persistence storage for CoreData in iOS

Here in
Apple's sample code I found this type of persistence storage.



Can anyone tell me what is CDBStore and
what is the advantage of using CDBStore as persistence storage over other storage types like sqlite, plist etc,



And in which all cases its not using ?





GWT: Adding a value change listener to EditTextCell widget

I want to do validation for EditTextCell widget in the grid. So I am trying to extend the EditTextCell and add a value change listener to the same, so that I can continue with the validation. But I am unable to add the same. Any help would be appreciated. Am using GWT 2.4.0



My code looks like this.



public class MyEditTextCell extends EditTextCell
{
//Value change listener??
}




Using boost 1_48 with Apache qpid on Windows

everybody.



I stuck while trying to compile qpid c++ with boost 1_47_0 using Visual Studio 2010.
Here is steps sequence, that I made:




  1. Built boost 1.48.0

  2. Added BOOST_ROOT, BOOST_INCLUDEDIR, BOOST_LIBRARYDIR, etc. to %PATH% env. variable

  3. Installed cmake, Python, Ruby and added their paths to %PATH% env. variable

  4. Untared qpid-cpp-0.14.tar.gz

  5. Applied patch from https://bugzilla.redhat.com/attachment.cgi?id=542165&action=diff due to last changes in boost file hierarchy

  6. Renamed a few, required by qpid, boost libraries from libbost_LIBRARY-vc100-mt-1_48.lib to boost_LIBRARY.lib format

  7. Launched "cmake -i -G 'Visual Studio 2010'" in the 'qpidc-0.14' directory and successfully received *.vcxproj files



Now, the problems were appeared.



I loaded 'ALL_BUILD.vcxproj' file, created on step 7, and tried to build one project - qpidcommon. But I couldn't, due to 'missing a library' error. I renamed boost libraries from libbost_LIBRARY-vc100-mt-1_48.lib to boost_LIBRARY-vc100-mt-1_48.lib file format again and tried to compile.



And, at least, I received next:



...
...
...
(__imp_??0variables_map@program_options@boost@@QAE@XZ) referenced in function
"public: void __thiscall qpid::Options::parse(int,char const * const *,class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)"
(?parse@Options@qpid@@QAEXHPBQBDABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)

3>D:\wc-gather\tplibs\qpidc-0.14\src\Release\qpidcommon.dll : fatal error LNK1120:
33 unresolved externals
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I have no ideas, how to handle this, without adding a library direct to project. Do you?



Thanks.





Determining durration between dates

I'm still pretty new to programming in BASH and i'm racking my brain on a problem. I'm trying to code a script for my work that would make it easy to calculate a refund on a given package cancelled before it's regular end date. Now the simple stuff like inputs and other such things I'm sure I can figure out with googling and experimentation (though should you choose to help with that I would be most appreciative).



What i'm not sure I could find how to do on my own is a script or set of commands that would be able to calculate the number of days / months between two dates and use that variable to calculate the total ammount of refund. I'll try and explain what I am trying to do here:



Input two dates (MM/DD/YYYY format) and get the difference in months and day, IE 3 months 13 days.



Input Base monthly rate



(Base * # of months) + ((base/30) * # of days) = Ammount customer used



Input how much customer payed - Ammount used = Ammount to be refunded



Then preferably it prints it in a manner that one could use to "show their work"



I know this is a bit much to ask for help with but I really could use a hand with the date calculator.



Thanks for any help in advance!



PS I did do a bit of searching beforehand and I found questions SIMILAR to this but nothing that really fit exactly what I needed.





rebuild a content of a Div tag in complete function of $.ajax

I have a 4 column table of products in template,each item in table has an anchor with onclick like this:



<div id="tablepro">
<table>
<tr>
{% for product in cat.products.all %}
{% if forloop.counter|divisibleby:4 %}
</tr>
<tr>
<td><center><a href="#" onclick="remove({{product.pk}});">delete</a></br><img style="width:200px;height:200px;" class="magnify" src="{{product.image.url}}" /></center></td>
{% else %}
<td><center><a href="#" onclick="remove({{product.pk}});">delete</a></br><img style="width:200px;height:200px;" class="magnify" src="{{product.image.url}}" /></center></td>
{% endif %}
{% endfor %}
</table>
</div>


in remove function I have :



function remove(id)
{
var URL='{% url CompanyHub.views.catDetails company.webSite,cat.id %}';
URL+='delpro/'+id+'/';
$jqr.ajax({
url:URL,
type:'POST',
complete:function(){
var str='<table><tr>';
{% for product in cat.products.all %}
{% if forloop.counter|divisibleby:4 %}
str+='</tr><tr>';
str+='<td><center><a href="#" onclick="remove({{product.pk}});">delete</a></br><img style="width:200px;height:200px;" class="magnify" src="{{product.image.url}}" /></center></td>';
{% else %}
str+='<td><center><a href="#" onclick="remove({{product.pk}});">delete</a></br><img style="width:200px;height:200px;" class="magnify" src="{{product.image.url}}" /></center></td>';
{% endif %}
{% endfor %}
str+='</table>';
$jqr('#tablepro').html(str);
},
error:function(){
alert('Error');
}
});
}


in views.py :



def deleteProduct(request,key,cat_id,pro_id):
try:
company=Company.objects.get(webSite__iexact=key)
except Company.DoesNotExist:
Http404
cat=Category.objects.get(pk=cat_id)
if pro_id:
try:
product=Product.objects.get(pk=pro_id)
product.delete()
except Product.DoesNotExist:
Http404
return render_to_response('CompanyHub/Company/%s/cat_details.html'%(company.theme),{'company':company,'cat':cat}, context_instance=RequestContext(request))


as U see I've returned cat object that now a product object has removed from its list,but I can't get my Div updated in template!



any suggestion is appreciated