Search Results

Search found 1255 results on 51 pages for 'todo'.

Page 8/51 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Need Help with .NET OpenId HttpHandler

    - by Mark E
    I'm trying to use a single HTTPHandler to authenticate a user's open id and receive a claimresponse. The initial authentication works, but the claimresponse does not. The error I receive is "This webpage has a redirect loop." What am I doing wrong? public class OpenIdLogin : IHttpHandler { private HttpContext _context = null; public void ProcessRequest(HttpContext context) { _context = context; var openid = new OpenIdRelyingParty(); var response = openid.GetResponse(); if (response == null) { // Stage 2: user submitting Identifier openid.CreateRequest(context.Request.Form["openid_identifier"]).RedirectToProvider(); } else { // Stage 3: OpenID Provider sending assertion response switch (response.Status) { case AuthenticationStatus.Authenticated: //FormsAuthentication.RedirectFromLoginPage(response.ClaimedIdentifier, false); string identifier = response.ClaimedIdentifier; //****** TODO only proceed if we don't have the user's extended info in the database ************** ClaimsResponse claim = response.GetExtension<ClaimsResponse>(); if (claim == null) { //IAuthenticationRequest req = openid.CreateRequest(identifier); IAuthenticationRequest req = openid.CreateRequest(Identifier.Parse(identifier)); var fields = new ClaimsRequest(); fields.Email = DemandLevel.Request; req.AddExtension(fields); req.RedirectingResponse.Send(); //Is this correct? } else { context.Response.ContentType = "text/plain"; context.Response.Write(claim.Email); //claim.FullName; } break; case AuthenticationStatus.Canceled: //TODO break; case AuthenticationStatus.Failed: //TODO break; } } }

    Read the article

  • I'm trying to make a php Curl call to formstack api, but I get nothing

    - by Oskar Calvo
    This is one of my first curls code, so it can have mistakes I'm trying to be able to make calls to form/:id/submissions https://www.formstack.com/developers/api/resources/submission#form/:id/submission_GET If I load: https://www.formstack.com/api/v2/form/1311091/submission.json?oauth_token=44eedc50d015b95164897f5e408670f0&min_time=2012-09-01%2000:01:01&max_time=2012-10-27%2000:01:01 If works great. If I try this code: <?php $host = 'https://www.formstack.com/api/v2/'; // TODO this should manage dinamics values or build an action in every method. $action = 'form/1311091/submission.json'; $url = $host . $action; // TODO this values will arrive like an array with values $postData['oauth_token']= '44eedc50d015b95164897f5e408670f0'; $postData['min_time'] ='2012-09-01 00:01:01'; $postData['max_time'] ='2012-10-27 00:01:01'; // TODO make a method with this action function getElements($postData) { $elements = array(); foreach ($postData as $name=>$value) { $elements[] = "{$name}=".urlencode($value); } } $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPGET, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $elements); $result = curl_exec($curl) ; curl_close($curl); var_dump($result); ?>

    Read the article

  • when I am executing webdriver scripts from command prompt I get error "could not find or load main class

    - by Rahul Belhekar
    I want to run below java file from command prompt. whenever I am running it from command line it gives error "Error:Could not find or load main class".This is regular java code.It runs well in eclipse but gives this error in command prompt.I have set classpath till my project bin also set "path" till bin folder of jdk, this file is getting compiled but not running from command prompt.please help me to resolve my issue.Waiting for your reply thank you public class RILookBookGetTheLook extends Libraryfile { public static void main(String[] args) { //Delcaring objects //String className = this.getClass().getName(); WebDriver driver; String baseUrl; final Log LOG = LogFactory.getLog(BrowserLocator.class); CsvWriter out; try { setUp(); } catch (Exception e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { Display_ProductPage(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } try { tearDown(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } I have written methods here which I called from main method Please guys help me to solve this problem

    Read the article

  • How to implement iterator as an attribute of a class in Java

    - by de3
    Hi, let's say I have this simple MyArray class, with two simple methods: add, delete and an iterator. In the main method we can see how it is supposed to be used: public class MyArray { int start; int end; int[] arr; myIterator it; public MyArray(){ this.start=0; this.end=0; this.arr=new int[500]; it=new myIterator(); } public void add(int el){ this.arr[this.end]=el; this.end++; } public void delete(){ this.arr[this.start]=0; this.start++; } public static void main(String[] args){ MyArray m=new MyArray(); m.add(3); m.add(299); m.add(19); m.add(27); while(m.it.hasNext()){ System.out.println(m.it.next()); } } And then MyIterator should be implemented somehow: import java.util.Iterator; public class myIterator implements Iterator{ @Override public boolean hasNext() { // TODO Auto-generated method stub return false; } @Override public Object next() { // TODO Auto-generated method stub return null; } @Override public void remove() { // TODO Auto-generated method stub } } MyIterator should iterate arr from MyArray class, from start to end values; both are also attributes of MyArray. So, as MyIterator should use MyArray attributes, how should MyIterator be implemented? Perhaps I can send the current object in the initialization: it=new myIterator(this); But I guess it's not the best soultion. Or maybe MyArray itself should implement Iterator interface? How is this solved?

    Read the article

  • Cannot make a static reference to the non-static type MyRunnable

    - by kaiwii ho
    Here is the whole code : import java.util.ArrayList; public class Test{ ThreadLocal<ArrayList<E>>arraylist=new ThreadLocal<ArrayList<E>>(){ @Override protected ArrayList<E> initialValue() { // TODO Auto-generated method stub //return super.initialValue(); ArrayList<E>arraylist=new ArrayList<E>(); for(int i=0;i<=20;i++) arraylist.add((E) new Integer(i)); return arraylist; } }; class MyRunnable implements Runnable{ private Test mytest; public MyRunnable(Test test){ mytest=test; // TODO Auto-generated constructor stub } @Override public void run() { System.out.println("before"+mytest.arraylist.toString()); ArrayList<E>myarraylist=(ArrayList<E>) mytest.arraylist.get(); myarraylist.add((E) new Double(Math.random())); mytest.arraylist.set(myarraylist); System.out.println("after"+mytest.arraylist.toString()); } // TODO Auto-generated method stub } public static void main(String[] args){ Test test=new Test<Double>(); System.out.println(test.arraylist.toString()); new Thread(new MyRunnable(test)).start(); new Thread(new MyRunnable(test)).start(); System.out.println(arraylist.toString()); } } my questions are: 1\ why the new Thread(new MyRunnable(test)).start(); cause the error: Cannot make a static reference to the non-static type MyRunnable ? 2\ what is the static reference refer to right here? thx in advanced

    Read the article

  • shell script segment to avoid overwriting files

    - by johndashen
    I have a perl script (or any executable) E which will take a file foo.xml and write a file foo.txt. I use a Beowulf cluster to run E for a large number of XML files, but I'd like to write a simple job server script in shell (bash) which doesn't overwrite existing txt files. I'm currently doing something like #!/bin/sh PATTERN="[A-Z]*0[1-2][a-j]"; # this matches foo in all cases todo=`ls *.xml | grep $PATTERN`; isdone=`ls *.foo | grep $PATTERN`; whatsleft=todo - isdone; # what's the unix magic? #and then call the job server; jobserve E "$whatsleft"; and then I don't know how to get the difference between $todo and $isdone. I'd prefer using sort/uniq to something like a for loop with grep inside, but I'm not sure how to do it (pipes? temporary files?) As a bonus question, is there a way to do lookahead search in bash grep?

    Read the article

  • How can I merge two Linq IEnumerable<T> queries without running them?

    - by makerofthings7
    How do I merge a List<T> of TPL-based tasks for later execution? public async IEnumerable<Task<string>> CreateTasks(){ /* stuff*/ } My assumption is .Concat() but that doesn't seem to work: void MainTestApp() // Full sample available upon request. { List<string> nothingList = new List<string>(); nothingList.Add("whatever"); cts = new CancellationTokenSource(); delayedExecution = from str in nothingList select AccessTheWebAsync("", cts.Token); delayedExecution2 = from str in nothingList select AccessTheWebAsync("1", cts.Token); delayedExecution = delayedExecution.Concat(delayedExecution2); } /// SNIP async Task AccessTheWebAsync(string nothing, CancellationToken ct) { // return a Task } I want to make sure that this won't spawn any task or evaluate anything. In fact, I suppose I'm asking "what logically executes an IQueryable to something that returns data"? Background Since I'm doing recursion and I don't want to execute this until the correct time, what is the correct way to merge the results if called multiple times? If it matters I'm thinking of running this command to launch all the tasks var AllRunningDataTasks = results.ToList(); followed by this code: while (AllRunningDataTasks.Count > 0) { // Identify the first task that completes. Task<TableResult> firstFinishedTask = await Task.WhenAny(AllRunningDataTasks); // ***Remove the selected task from the list so that you don't // process it more than once. AllRunningDataTasks.Remove(firstFinishedTask); // TODO: Await the completed task. var taskOfTableResult = await firstFinishedTask; // Todo: (doen't work) TrustState thisState = (TrustState)firstFinishedTask.AsyncState; // TODO: Update the concurrent dictionary with data // thisState.QueryStartPoint + thisState.ThingToSearchFor Interlocked.Decrement(ref thisState.RunningDirectQueries); Interlocked.Increment(ref thisState.CompletedDirectQueries); if (thisState.RunningDirectQueries == 0) { thisState.TimeCompleted = DateTime.UtcNow; } }

    Read the article

  • Implementing deadlock condition

    - by Bhaskar
    I am trying to implementing deadlock condition but somehow I am not able to get it working. Both the threads Thread1 and Thread2 are entering in the run function but only one of them enters in Sub/Sum depending on who entered run first. Example : if Thread2 entered run first the it will call sub() and Thread1 never calls sum(). I have also added sleep time so that Thread2 sleeps before calling sum() and Thread1 gets enough time to enter Sum() but Thread1 never enters. public class ExploringThreads { public static void main(String[] args) { // TODO Auto-generated method stub threadexample a1 = new threadexample(); Thread t1 = new Thread(a1, "Thread1"); Thread t2 = new Thread(a1,"Thread2"); t1.start(); t2.start(); } } class threadexample implements Runnable{ public int a = 10; public void run(){ if(Thread.currentThread().getName().equals("Thread1")) sum(); else if(Thread.currentThread().getName().equals("Thread2")) sub(); } public synchronized void sum() { try { Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println(Thread.currentThread().getName()+"In Sum"); sub(); } public synchronized void sub() { try { Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println(Thread.currentThread().getName()+"In Sub"); sum(); } }

    Read the article

  • Android Expandable List View Update

    - by Gaurav Arora
    I am implementing a chatting application, where I have made a service to listen all the presence changed. On the change of the presence I want to update the data and I am unable to update the data that is showing in the expandable list view. Please suggest me a means to do the same. public class UserMenuActivity extends ExpandableListActivity { private XMPPConnection connection; String name,availability,subscriptionStatus; TextView tv_Status; /** Variable Define here */ private String[] data = { "View my profile", "New Multiperson Chat", "New Broad Cast Message", "New Contact Category", "New Group", "Invite to CCM", "Search", "Expand All", "Settings", "Help", "Close" }; private String[] data_Contact = { "Rename Category","Move Contact to Category", "View my profile", "New Multiperson Chat", "New Broad Cast Message", "New Contact Category", "New Group", "Invite to CCM", "Search", "Expand All", "Settings", "Help", "Close" }; private String[] data_child_contact = { "Open chat", "Delete Contact","View my profile", "New Multiperson Chat", "New Broad Cast Message", "New Contact Category", "New Group", "Invite to CCM", "Search", "Expand All", "Settings", "Help", "Close" }; private String[] menuItem = { "Chats", "Contacts", "CGM Groups", "Pending","Request" }; private List<String> menuItemList = Arrays.asList(menuItem); private int commonGroupPosition = 0; private String etAlertVal; private DatabaseHelper dbHelper; private int categoryID, listPos; /** New Code here.. */ private ArrayList<String> groupNames; private ArrayList<ArrayList<ChildItems>> childs; private UserMenuAdapter adapter; private Object object; private String[] data2 = { "PIN Michelle", "IP Call" }; private ListView mlist2; private ImageButton mimBtnMenu; private LinearLayout mllpopmenu; private View popupView; private PopupWindow popupWindow; private AlertDialog.Builder alert; private EditText input; private TextView mtvUserName, mtvUserTagLine; private ExpandableListView mExpandableListView; public static List<CategoryDataClass> categoryList; private boolean menuType = false; private String childValContact=""; public static Context context; @Override public void onBackPressed() { if (mllpopmenu.getVisibility() == View.VISIBLE) { mllpopmenu.setVisibility(View.INVISIBLE); } else { if (CCMStaticVariable.CommonConnection.isConnected()) { CCMStaticVariable.CommonConnection.disconnect(); } super.onBackPressed(); } } @SuppressWarnings("unchecked") @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_MENU) { if (mllpopmenu.getVisibility() == View.VISIBLE) { mllpopmenu.setVisibility(View.INVISIBLE); } else { if (commonGroupPosition >= 4 && menuType == true) { if(childValContact == ""){ mllpopmenu.setVisibility(View.VISIBLE); mlist2.setAdapter(new ArrayAdapter(UserMenuActivity.this, R.layout.listviewtext, R.id.tvMenuText, data_Contact)); }else{ mllpopmenu.setVisibility(View.VISIBLE); mlist2.setAdapter(new ArrayAdapter(UserMenuActivity.this, R.layout.listviewtext, R.id.tvMenuText, data_child_contact)); } } else if (commonGroupPosition == 0) { mllpopmenu.setVisibility(View.VISIBLE); mlist2.setAdapter(new ArrayAdapter(UserMenuActivity.this, R.layout.listviewtext, R.id.tvMenuText, data)); } } return true; } return super.onKeyDown(keyCode, event); } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.usermenulayout); dbHelper = new DatabaseHelper(UserMenuActivity.this); //this.context = context.getApplicationContext(); XMPPConn.getContactList(); connection = CCMStaticVariable.CommonConnection; Presence userPresence = new Presence(Presence.Type.available); userPresence.setPriority(24); userPresence.setMode(Presence.Mode.away); connection.sendPacket(userPresence); } @Override protected void onResume() { super.onResume(); Presence userPresence = new Presence(Presence.Type.available); userPresence.setPriority(24); userPresence.setMode(Presence.Mode.away); connection.sendPacket(userPresence); XMPPConn.getContactList(); setExpandableListView(); } public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { if (groupPosition == 1 && childPosition == 0) { startActivity(new Intent(UserMenuActivity.this, InvitetoCCMActivity.class)); } else if (groupPosition == 1 && childPosition != 0) { Intent intent = new Intent(UserMenuActivity.this, UserChatActivity.class); intent.putExtra("userNameVal", XMPPConn.mfriendList.get(childPosition - 1).friendName); startActivity(intent); } else if (groupPosition == 2 && childPosition == 0) { startActivity(new Intent(UserMenuActivity.this, CreateGroupActivity.class)); } else if (groupPosition == 2 && childPosition != 0) { String GROUP_NAME = childs.get(groupPosition).get(childPosition) .getName().toString(); int end = GROUP_NAME.indexOf("("); CCMStaticVariable.groupName = GROUP_NAME.substring(0, end).trim(); startActivity(new Intent(UserMenuActivity.this, GroupsActivity.class)); } else if (groupPosition >= 4) { childValContact = childs.get(groupPosition).get(childPosition).getName().trim(); showToast("user==>"+childValContact, 0); } return false; } private void setExpandableListView() { /***###############GROUP ARRAY ############################*/ final ArrayList<String> groupNames = new ArrayList<String>(); groupNames.add("Chats (2)"); groupNames.add("Contacts (" + XMPPConn.mfriendList.size() + ")"); groupNames.add("CGM Groups (" + XMPPConn.mGroupList.size() + ")"); groupNames.add("Pending (1)"); XMPPConn.getGroup(); categoryList = dbHelper.getAllCategory(); /**Group From Sever*/ if (XMPPConn.mGroupList.size() > 0) { for (int g = 0; g < XMPPConn.mGroupList.size(); g++) { XMPPConn.getGroupContact(XMPPConn.mGroupList.get(g).groupName); groupNames.add(XMPPConn.mGroupList.get(g).groupName + "(" + XMPPConn.mGroupContactList.size()+ ")"); } } if(categoryList.size() > 0){ for (int cat = 0; cat < categoryList.size(); cat++) { groupNames.add(categoryList.get(cat).getCategoryName()+ "(0)"); } } this.groupNames = groupNames; /*** ###########CHILD ARRAY * #################*/ ArrayList<ArrayList<ChildItems>> childs = new ArrayList<ArrayList<ChildItems>>(); ArrayList<ChildItems> child = new ArrayList<ChildItems>(); child.add(new ChildItems("Alisha", "Hi",0)); child.add(new ChildItems("Michelle", "Good Morning",0)); childs.add(child); child = new ArrayList<ChildItems>(); child.add(new ChildItems("", "",0)); if (XMPPConn.mfriendList.size() > 0) { for (int n = 0; n < XMPPConn.mfriendList.size(); n++) { child.add(new ChildItems(XMPPConn.mfriendList.get(n).friendNickName, XMPPConn.mfriendList.get(n).friendStatus, XMPPConn.mfriendList.get(n).friendState)); } } childs.add(child); /************** CGM Group Child here *********************/ child = new ArrayList<ChildItems>(); child.add(new ChildItems("", "",0)); if (XMPPConn.mGroupList.size() > 0) { for (int grop = 0; grop < XMPPConn.mGroupList.size(); grop++) { child.add(new ChildItems( XMPPConn.mGroupList.get(grop).groupName + " (" + XMPPConn.mGroupList.get(grop).groupUserCount + ")", "",0)); } } childs.add(child); child = new ArrayList<ChildItems>(); child.add(new ChildItems("Shuchi", "Pending (Waiting for Authorization)",0)); childs.add(child); /************************ Group Contact List *************************/ if (XMPPConn.mGroupList.size() > 0) { for (int g = 0; g < XMPPConn.mGroupList.size(); g++) { /** Contact List */ XMPPConn.getGroupContact(XMPPConn.mGroupList.get(g).groupName); child = new ArrayList<ChildItems>(); for (int con = 0; con < XMPPConn.mGroupContactList.size(); con++) { child.add(new ChildItems( XMPPConn.mGroupContactList.get(con).friendName, XMPPConn.mGroupContactList.get(con).friendStatus,0)); } childs.add(child); } } if(categoryList.size() > 0){ for (int cat = 0; cat < categoryList.size(); cat++) { child = new ArrayList<ChildItems>(); child.add(new ChildItems("-none-", "",0)); childs.add(child); } } this.childs = childs; /** Set Adapter here */ adapter = new UserMenuAdapter(this, groupNames, childs); setListAdapter(adapter); object = this; mlist2 = (ListView) findViewById(R.id.list2); mimBtnMenu = (ImageButton) findViewById(R.id.imBtnMenu); mllpopmenu = (LinearLayout) findViewById(R.id.llpopmenu); mtvUserName = (TextView) findViewById(R.id.tvUserName); mtvUserTagLine = (TextView) findViewById(R.id.tvUserTagLine); //Set User name.. System.out.println("CCMStaticVariable.loginUserName===" + CCMStaticVariable.loginUserName); if (!CCMStaticVariable.loginUserName.equalsIgnoreCase("")) { mtvUserName.setText("" + CCMStaticVariable.loginUserName); } /** Expandable List set here.. */ mExpandableListView = (ExpandableListView) this .findViewById(android.R.id.list); mExpandableListView.setOnGroupClickListener(new OnGroupClickListener() { @Override public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { XMPPConn.getContactList(); if (parent.isGroupExpanded(groupPosition)) { commonGroupPosition = 0; }else{ commonGroupPosition = groupPosition; } String GROUP_NAME = groupNames.get(groupPosition); int end = groupNames.get(groupPosition).indexOf("("); String GROUP_NAME_VALUE = GROUP_NAME.substring(0, end).trim(); if (menuItemList.contains(GROUP_NAME_VALUE)) { menuType = false; CCMStaticVariable.groupCatName = GROUP_NAME_VALUE; } else { menuType = true; CCMStaticVariable.groupCatName = GROUP_NAME_VALUE; } long findCatId = dbHelper.getCategoryID(GROUP_NAME_VALUE); if (findCatId != 0) { categoryID = (int) findCatId; } childValContact=""; showToast("Clicked on==" + GROUP_NAME_VALUE, 0); return false; } }); /** Click on item */ mlist2.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int pos,long arg3) { if (commonGroupPosition >= 4) { if(childValContact == ""){ if (pos == 0) { showAlertEdit(CCMStaticVariable.groupCatName); } /** Move contact to catgory */ if (pos == 1) { startActivity(new Intent(UserMenuActivity.this,AddContactCategoryActivity.class)); } }else{ if(pos == 0){ Intent intent = new Intent(UserMenuActivity.this,UserChatActivity.class); intent.putExtra("userNameVal",childValContact); startActivity(intent); } if(pos == 1){ XMPPConn.removeEntry(childValContact); showToast("Contact deleted sucessfully", 0); Intent intent = new Intent(UserMenuActivity.this,UserMenuActivity.class); } } } else { /** MyProfile */ if (pos == 0) { startActivity(new Intent(UserMenuActivity.this, MyProfileActivity.class)); } /** New multiperson chat start */ if (pos == 1) { startActivity(new Intent(UserMenuActivity.this, NewMultipersonChatActivity.class)); } /** New Broadcast message */ if (pos == 2) { startActivity(new Intent(UserMenuActivity.this, NewBroadcastMessageActivity.class)); } /** Click on add category */ if (pos == 3) { showAlertAdd(); } if (pos == 4) { startActivity(new Intent(UserMenuActivity.this, CreateGroupActivity.class)); } if (pos == 5) { startActivity(new Intent(UserMenuActivity.this, InvitetoCCMActivity.class)); } if (pos == 6) { startActivity(new Intent(UserMenuActivity.this, SearchActivity.class)); } if (pos == 7) { onGroupExpand(2); for (int i = 0; i < groupNames.size(); i++) { mExpandableListView.expandGroup(i); } } /** Click on settings */ if (pos == 8) { startActivity(new Intent(UserMenuActivity.this, SettingsActivity.class)); } if (pos == 10) { System.exit(0); } if (pos == 14) { if (mllpopmenu.getVisibility() == View.VISIBLE) { mllpopmenu.setVisibility(View.INVISIBLE); if (popupWindow.isShowing()) { popupWindow.dismiss(); } } else { mllpopmenu.setVisibility(View.VISIBLE); mlist2.setAdapter(new ArrayAdapter( UserMenuActivity.this, R.layout.listviewtext, R.id.tvMenuText, data)); } } } } }); } /** Toast message display here.. */ private void showToast(String msg, int time) { Toast.makeText(this, msg, time).show(); } public String showSubscriptionStatus(String friend){ return friend; } } Service.class public class UpdaterService extends Service { private XMPPConnection connection; String Friend; String user = ""; @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } @Override public void onCreate() { // Toast.makeText(this, "My Service Created", Toast.LENGTH_LONG).show(); super.onCreate(); } @Override public void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Override public void onStart(Intent intent, int startId) { // TODO Auto-generated method stub showToast("My Service Started", 0); connection = getConnection(); if (connection.isConnected()) { final Roster roster = connection.getRoster(); RosterListener r1 = new RosterListener() { @Override public void presenceChanged(Presence presence) { // TODO Auto-generated method stub XMPPConn.getContactList(); } @Override public void entriesUpdated(Collection<String> arg0) { // TODO Auto-generated method stub //notification("entriesUpdated"); } @Override public void entriesDeleted(Collection<String> arg0) { // TODO Auto-generated method stub //notification("entriesDeleted"); } @Override public void entriesAdded(Collection<String> arg0) { // TODO Auto-generated method stub Iterator<String> it = arg0.iterator(); if (it.hasNext()) { user = it.next(); } RosterEntry entry = roster.getEntry(user); if(entry.getType().toString().equalsIgnoreCase("to")){ int index_of_Alpha = Friend.indexOf("@"); String subID = Friend.substring(0, index_of_Alpha); notification("Hi "+subID+" wants to add you"); } } }; if (roster != null) { roster.setSubscriptionMode(Roster.SubscriptionMode.manual); System.out.println("subscription going on"); roster.addRosterListener(r1); } } else { showToast("Connection lost-", 0); } } protected void showToast(String msg, int time) { Toast.makeText(this, msg, time).show(); } private XMPPConnection getConnection() { return CCMStaticVariable.CommonConnection; } /** Notification manager */ private void notification(CharSequence message) { String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); int icon = R.drawable.ic_launcher; CharSequence tickerText = message; long when = System.currentTimeMillis(); Notification notification = new Notification(icon, tickerText, when); Context context = getApplicationContext(); CharSequence contentTitle = "CCM"; CharSequence contentText = message; Intent notificationIntent = new Intent(this, ManageNotification.class); notificationIntent.putExtra("Subscriber_ID",user ); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); notification.flags |= Notification.FLAG_AUTO_CANCEL; final int HELLO_ID = 1; mNotificationManager.notify(HELLO_ID, notification); } } Here is my adapter class public class UserMenuAdapter extends BaseExpandableListAdapter { private ArrayList<String> groups; private ArrayList<ArrayList<ChildItems>> childs; private Context context; public LayoutInflater inflater; ImageView img_availabiliy; private static final int[] EMPTY_STATE_SET = {}; private static final int[] GROUP_EXPANDED_STATE_SET = {android.R.attr.state_expanded}; private static final int[][] GROUP_STATE_SETS = { EMPTY_STATE_SET, // 0 GROUP_EXPANDED_STATE_SET // 1 }; public UserMenuAdapter(Context context, ArrayList<String> groups, ArrayList<ArrayList<ChildItems>> childs) { this.context = context; this.groups = groups; this.childs = childs; inflater = LayoutInflater.from(context); } @Override public Object getChild(int groupPosition, int childPosition) { return childs.get(groupPosition).get(childPosition); } @Override public long getChildId(int groupPosition, int childPosition) { return (long) (groupPosition * 1024 + childPosition); } @Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { View v = null; if (convertView != null) v = convertView; else v = inflater.inflate(R.layout.child_layout, parent, false); ChildItems ci = (ChildItems) getChild(groupPosition, childPosition); TextView tv = (TextView) v.findViewById(R.id.tvChild); tv.setText(ci.getName()); TextView tv2 = (TextView) v.findViewById(R.id.tvChild2); tv2.setText(ci.getDailyStatus()); img_availabiliy = (ImageView)v.findViewById(R.id.img_childlayout_AVAILABILITY); ImageView friendPics = (ImageView)v.findViewById(R.id.ivFriendPics); if(ci.getStatusState() == 1){ img_availabiliy.setImageResource(R.drawable.online); } else if(ci.getStatusState()==0){ img_availabiliy.setImageResource(R.drawable.offline); } else if (ci.getStatusState()==2) { img_availabiliy.setImageResource(R.drawable.away); } else if(ci.getStatusState()==3){ img_availabiliy.setImageResource(R.drawable.busy); } else{ img_availabiliy.setImageDrawable(null); } if((groupPosition == 1 && childPosition == 0)){ friendPics.setImageResource(R.drawable.inviteto_ccm); img_availabiliy.setVisibility(View.INVISIBLE); } else if(groupPosition == 2 && childPosition == 0){ friendPics.setImageResource(R.drawable.new_ccmgroup); img_availabiliy.setVisibility(View.VISIBLE); }else{ if(ci.getPicture()!= null){ Bitmap bitmap = BitmapFactory.decodeByteArray(ci.getPicture(), 0, ci.getPicture().length); bitmap = Bitmap.createScaledBitmap(bitmap, 50, 50, true); friendPics.setImageBitmap(bitmap); }else{ friendPics.setImageResource(R.drawable.avatar); } img_availabiliy.setVisibility(View.VISIBLE); } return v; } @Override public int getChildrenCount(int groupPosition) { return childs.get(groupPosition).size(); } @Override public Object getGroup(int groupPosition) { return groups.get(groupPosition); } @Override public int getGroupCount() { return groups.size(); } @Override public long getGroupId(int groupPosition) { return (long) (groupPosition * 1024); } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { View v = null; if (convertView != null) v = convertView; else v = inflater.inflate(R.layout.group_layout, parent, false); String gt = (String) getGroup(groupPosition); TextView tv2 = (TextView) v.findViewById(R.id.tvGroup); if (gt != null) tv2.setText(gt); /**Set Image on group layout, Max/min*/ View ind = v.findViewById( R.id.explist_indicator); View groupInd = v.findViewById( R.id.llgroup); if( ind != null ) { ImageView indicator = (ImageView)ind; if( getChildrenCount( groupPosition ) == 0 ) { indicator.setVisibility( View.INVISIBLE ); } else { indicator.setVisibility( View.VISIBLE ); int stateSetIndex = ( isExpanded ? 1 : 0) ; Drawable drawable = indicator.getDrawable(); drawable.setState(GROUP_STATE_SETS[stateSetIndex]); } } if( groupInd != null ) { RelativeLayout indicator2 = (RelativeLayout)groupInd; if( getChildrenCount( groupPosition ) == 0 ) { indicator2.setVisibility( View.INVISIBLE ); } else { indicator2.setVisibility( View.VISIBLE ); int stateSetIndex = ( isExpanded ? 1 : 0) ; Drawable drawable2 = indicator2.getBackground(); drawable2.setState(GROUP_STATE_SETS[stateSetIndex]); } } return v; } @Override public boolean hasStableIds() { return true; } @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } public void onGroupCollapsed(int groupPosition) { } public void onGroupExpanded(int groupPosition) { } } I just want to update my list in ON PRESENCE CHANGED method in the Service class.. Please suggest me a means to do the same.

    Read the article

  • Shortcut key to forward email to fixed email address in Postbox

    - by Jos v.d. Voort v.d. Kleij
    As an avid user of todo apps (currently Asana) is very much miss a way to easily forward an email from Postbox to my GTD app. Currently the workflow is: Click cmd/L to open the forward email window Type [email protected] in the To: address field Click the send button in the forward email window What I would like to have is an automator or applescript that does that for me. Ex: Highligh/select the mail I wish to convert to a task in Asana and the type a shortcut like ctrl/cmd/L to forward the mail to Asana. As most todo apps have custom email addresses you can use to convert an email into a task, the only thing that needs to be changed is the email address in the script. For Asana this would not be necessary because the email address for converting an email into a taks is the same for all Asana users.

    Read the article

  • WCF Service, Java JApplet client, transport error 405

    - by Juan Zamudio
    Hi all, I'm having a problem with a WCF Service and Java Client, I will try to give as much information as i can, thanks for your time. The Endpoint of the server is BasicHttpBinding, I tried hosting the server as a Windows Service and in IIS but nothing changed. The weird thing is that the Client works great if I use a simple class, in the moment I switch the class to an JApplet I get the problem mentioned. I'm using Eclipse as an IDE, I tried Axis and Metro to generate the stub with the same bad results. Here is an example of the Java class where everything is working public class TestSoaMetro { public String TestMethod(){ String result=null; IDigitalSignatureService aa = new DigitalSignatureService().getBasicHttpBindingEndpoint(); try { result= aa.getData("1", "id002962"); } catch (IDigitalSignatureServiceGetDataArgumentExceptionFaultFaultMessage e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IDigitalSignatureServiceGetDataInvalidOperationExceptionFaultFaultMessage e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } } Here is the example of the JApplet where I get the error: public class TestSoaMetroApplet extends JApplet { public void init() { Container content = getContentPane(); content.setBackground(Color.white); content.setLayout(new FlowLayout()); String result= this.TestMethod(); JLabel label = new JLabel(result); content.add(label); } public String TestMethod(){ String result=null; IDigitalSignatureService aa = null; try { aa = new DigitalSignatureService().getBasicHttpBindingEndpoint(); result= aa.getData("1", "id002962"); } catch (IDigitalSignatureServiceGetDataArgumentExceptionFaultFaultMessage e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IDigitalSignatureServiceGetDataInvalidOperationExceptionFaultFaultMessage e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } } In the moment the Applet loads I get the error, is the exact same call so I don't understand why I get the exception using the Applet. I Also tried to call this from a Silverlight client and I was getting a security exception, this is where I found out about clientaccesspolicy.xml and crossdomain.xml, I added clientaccesspolicy.xml to the service and the Silverlight Client works great, so I decided to try crossdomain.xml and nothing, the Applet still does not work. I will put the stack trace at the end, thanks all for your time. Juan Zamudio javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: Transport error: 405 Error: Method not allowed at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128) at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:559) at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:118) at org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:82) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:317) at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:159) at $Proxy12.getData(Unknown Source) at TestSoaMetroApplet.TestMethod(TestSoaMetroApplet.java:28) at TestSoaMetroApplet.init(TestSoaMetroApplet.java:19) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.axis2.AxisFault: Transport error: 405 Error: Method not allowed at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:295) at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:190) at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:389) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:222) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:554) ... 9 more

    Read the article

  • Progressbar blocks notiyfyDatasetChanged() method in Android

    - by pathfinder
    I'm trying to display a ProgressBar while a listview is being populated. This is my XML <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:divider="@null" android:dividerHeight="0dp" android:fadingEdge="none" > </ListView> <ProgressBar android:id="@+id/doProgress" android:layout_width="60dp" android:layout_height="60dp" android:layout_gravity="center" /> </FrameLayout> ProgressBar's visibiliy has been changed in the onPostExecuteMethod when the whole listview is loaded. AsyncTask Code: public class WhatToDoLoader extends AsyncTask<String, String, String> { ProgressDialog progress = new ProgressDialog(WhatToDo.this); String url = "http://wearedesigners.net/clients/clients12/tourism/fetchWhatToDoList.php"; final String TAG_MAIN = "item"; final String TAG_ID = "itemId"; final String TAG_NAME = "itemName"; final String TAG_DETAIL = "itemDetailText"; final String TAG_ITEM_IMAGE = "itemImages"; final String TAG_MAP = "itemMapData"; final String TAG_MAP_IMAGE = "mapImage"; @Override protected void onProgressUpdate(String... values) { // TODO Auto-generated method stub super.onProgressUpdate(values); adapter.notifyDataSetChanged(); } @Override protected void onPreExecute() { // TODO Auto-generated method stub super.onPreExecute(); /* * progress.setMessage("Loading What To Do List"); progress.show(); */ } @Override protected String doInBackground(String... params) { XMLParser parser = new XMLParser(); String xml = parser.getXmlFromUrl(url); // getting XML Document doc = parser.getDomElement(xml); // getting DOM element NodeList nl = doc.getElementsByTagName(TAG_MAIN); // TODO Auto-generated method stub for (int i = 0; i < nl.getLength(); i++) { // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); Element e = (Element) nl.item(i); // adding each child node to HashMap key => value map.put(TAG_ID, parser.getValue(e, TAG_ID)); map.put(TAG_NAME, parser.getValue(e, TAG_NAME)); map.put(TAG_DETAIL, parser.getValue(e, TAG_DETAIL)); map.put(TAG_MAP, parser.getValue(e, TAG_MAP)); map.put(TAG_MAP_IMAGE, parser.getValue(e, TAG_MAP_IMAGE)); map.put(TAG_ITEM_IMAGE, parser.getValue(e, TAG_ITEM_IMAGE)); System.out.println("Test : " + parser.getValue(e, TAG_ID)); // adding HashList to ArrayList whatToDoInfo.add(map); publishProgress(""); } return null; } @Override protected void onPostExecute(String result) { // TODO Auto-generated method stub super.onPostExecute(result); ProgressBar pb = (ProgressBar) findViewById(R.id.doProgress); pb.setVisibility(pb.INVISIBLE); } } When i run the code it throws the following exception. *java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread.* But the same code works fine when the progressbar feature is omitted. I can't find where i'm going wrong. can someone please help me ? Thank you in advance.

    Read the article

  • screnshot in android

    - by ujjawal
    The following is the code I am using to take a screen shot using GLSurfaceView. But I dont know why the onDraw() method in the GLSurfaceView.Renderer Class is not being called. Please if some one can look at the code below and point out what am I doing wrong.`public class MainActivity extends Activity { private GLSurfaceView mGLView; int x,y,w,h; Display disp; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); // ToDo add your GUI initialization code here setContentView(R.layout.main); x=0; y=0; disp = getWindowManager().getDefaultDisplay(); w = disp.getWidth(); h = disp.getHeight(); mGLView = new ClearGLSurfaceView(this); } class ClearGLSurfaceView extends GLSurfaceView { public ClearGLSurfaceView(Context context) { super(context); setDebugFlags(DEBUG_CHECK_GL_ERROR | DEBUG_LOG_GL_CALLS); mRenderer = new ClearRenderer(); setRenderer(mRenderer); } ClearRenderer mRenderer; } class ClearRenderer implements GLSurfaceView.Renderer { public void onSurfaceCreated(GL10 gl, EGLConfig config) { // Do nothing special. } public void onSurfaceChanged(GL10 gl, int w, int h) { //gl.glViewport(0, 0, w, h); } public void onDrawFrame(GL10 gl) { //gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); int b[]=new int[w*(y+h)]; int bt[]=new int[w*h]; IntBuffer ib=IntBuffer.wrap(b); ib.position(0); gl.glReadPixels(x, 0, w, y+h, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, ib); for(int i=0, k=0; i<h; i++, k++) {//remember, that OpenGL bitmap is incompatible with Android bitmap //and so, some correction need. for(int j=0; j<w; j++) { int pix=b[i*w+j]; int pb=(pix>>16)&0xff; int pr=(pix<<16)&0x00ff0000; int pix1=(pix&0xff00ff00) | pr | pb; bt[(h-k-1)*w+j]=pix1; } } Bitmap bmp = Bitmap.createBitmap(bt, w, h,Bitmap.Config.ARGB_8888); try { File f = new File("/sdcard/testpicture.png"); f.createNewFile(); FileOutputStream fos=new FileOutputStream(f); bmp.compress(CompressFormat.PNG, 100, fos); try { fos.flush(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { fos.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch(IOException e) { e.printStackTrace(); } } } } ` Please someone help me out. I have just started learning to work on android.

    Read the article

  • Android : Providing auto autosuggestion in android places Api?

    - by user1787493
    I am very new to android Google maps i write the following program for displaying the auto sugesstion in the android when i am type the text in the Autocomplete text box it is going the input to the url but the out put is not showing in the program .please see once and let me know where i am doing the mistake. package com.example.exampleplaces; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONObject; import org.json.JSONTokener; import android.app.Activity; import android.os.AsyncTask; import android.os.Bundle; import android.provider.SyncStateContract.Constants; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; import android.view.View; import android.widget.AutoCompleteTextView; import android.widget.ProgressBar; public class Place extends Activity { private AutoCompleteTextView mAtv_DestinationLocaiton; public ArrayList<String> autocompletePlaceList; public boolean DestiClick2; private ProgressBar destinationProgBar; private static final String GOOGLE_PLACE_API_KEY = ""; private static final String GOOGLE_PLACE_AUTOCOMPLETE_URL = "https://maps.googleapis.com/maps/api/place/autocomplete/json?"; //https://maps.googleapis.com/maps/api/place/autocomplete/output?parameters @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); autocompletePlaceList = new ArrayList<String>(); destinationProgBar=(ProgressBar)findViewById(R.id.progressBar1); mAtv_DestinationLocaiton = (AutoCompleteTextView) findViewById(R.id.et_govia_destination_location); mAtv_DestinationLocaiton.addTextChangedListener(new TextWatcher() { public void onTextChanged(CharSequence s, int start, int before, int count) { Log.i("Count", "" + count); if (!mAtv_DestinationLocaiton.isPerformingCompletion()) { autocompletePlaceList.clear(); DestiClick2 = false; new loadDestinationDropList().execute(s.toString()); } } public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } }); } private class loadDestinationDropList extends AsyncTask<String, Void, ArrayList<String>> { @Override protected void onPreExecute() { // Showing progress dialog before sending http request destinationProgBar.setVisibility(View.INVISIBLE); } protected ArrayList<String> doInBackground(String... unused) { try { Thread.sleep(3000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } autocompletePlaceList = getAutocompletePlaces(mAtv_DestinationLocaiton.getText().toString()); return autocompletePlaceList; } public ArrayList<String> getAutocompletePlaces(String placeName) { String response2 = ""; ArrayList<String> autocompletPlaceList = new ArrayList<String>(); String url = GOOGLE_PLACE_AUTOCOMPLETE_URL + "input=" + placeName + "&sensor=false&key=" + GOOGLE_PLACE_API_KEY; Log.e("MyAutocompleteURL", "" + url); try { //response2 = httpCall.connectToGoogleServer(url); JSONObject jsonObj = (JSONObject) new JSONTokener(response2.trim() .toString()).nextValue(); JSONArray results = (JSONArray) jsonObj.getJSONArray("predictions"); for (int i = 0; i < results.length(); i++) { Log.e("RESULTS", "" + results.getJSONObject(i).getString("description")); autocompletPlaceList.add(results.getJSONObject(i).getString( "description")); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return autocompletPlaceList; } } }

    Read the article

  • Solution: Testing Web Services with MSTest on Team Build

    - by Martin Hinshelwood
    Guess what. About 20 minutes after I fixed the build, Allan broke it again! Update: 4th March 2010 – After having huge problems getting this working I read Billy Wang’s post which showed me the light. The problem here is that even though the test passes locally it will not during an Automated Build. When you send your tests to the build server it does not understand that you want to spin up the web site and run tests against that! When you run the test in Visual Studio it spins up the web site anyway, but would you expect your test to pass if you told the website not to spin up? Of course not. So, when you send the code to the build server you need to tell it what to spin up. First, the best way to get the parameters you need is to right click on the method you want to test and select “Create Unit Test”. This will detect wither you are running in IIS or ASP.NET Development Server or None, and create the relevant tags. Figure: Right clicking on “SaveDefaultProjectFile” will produce a context menu with “Create Unit tests…” on it. If you use this option it will AutoDetect most of the Attributes that are required. /// <summary> ///A test for SSW.SQLDeploy.SilverlightUI.Web.Services.IProfileService.SaveDefaultProjectFile ///</summary> // TODO: Ensure that the UrlToTest attribute specifies a URL to an ASP.NET page (for example, // http://.../Default.aspx). This is necessary for the unit test to be executed on the web server, // whether you are testing a page, web service, or a WCF service. [TestMethod()] [HostType("ASP.NET")] [AspNetDevelopmentServerHost("D:\\Workspaces\\SSW\\SSW\\SqlDeploy\\DEV\\Main\\SSW.SQLDeploy.SilverlightUI.Web", "/")] [UrlToTest("http://localhost:3100/")] [DeploymentItem("SSW.SQLDeploy.SilverlightUI.Web.dll")] public void SaveDefaultProjectFileTest() { IProfileService target = new ProfileService(); // TODO: Initialize to an appropriate value string strComputerName = string.Empty; // TODO: Initialize to an appropriate value bool expected = false; // TODO: Initialize to an appropriate value bool actual; actual = target.SaveDefaultProjectFile(strComputerName); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); } Figure: Auto created code that shows the attributes required to run correctly in IIS or in this case ASP.NET Development Server If you are a purist and don’t like creating unit tests like this then you just need to add the three attributes manually. HostType – This attribute specified what host to use. Its an extensibility point, so you could write your own. Or you could just use “ASP.NET”. UrlToTest – This specifies the start URL. For most tests it does not matter which page you call, as long as it is a valid page otherwise your test may not run on the server, but may pass anyway. AspNetDevelopmentServerHost – This is a nasty one, it is only used if you are using ASP.NET Development Host and is unnecessary if you are using IIS. This sets the host settings and the first value MUST be the physical path to the root of your web application. OK, so all that was rubbish and I could not get anything working using the MSDN documentation. Google provided very little help until I ran into Billy Wang’s post  and I heard that heavenly music that all developers hear when understanding dawns that what they have been doing up until now is just plain stupid. I am sure that the above will work when I am doing Web Unit Tests, but there is a much easier way when doing web services. You need to add the AspNetDevelopmentServer attribute to your code. This will tell MSTest to spin up an ASP.NET Development server to host the service. Specify the path to the web application you want to use. [AspNetDevelopmentServer("WebApp1", "D:\\Workspaces\\SSW\\SSW\\SqlDeploy\\DEV\\Main\\SSW.SQLDeploy.SilverlightUI.Web")] [DeploymentItem("SSW.SQLDeploy.SilverlightUI.Web.dll")] [TestMethod] public void ProfileService_Integration_SaveDefaultProjectFile_Returns_True() { ProfileServiceClient target = new ProfileServiceClient(); bool isTrue = target.SaveDefaultProjectFile("Mav"); Assert.AreEqual(true, isTrue); } Figure: This AspNetDevelopmentServer will make sure that the specified web application is launched. Now we can run the test and have it pass, but if the dynamically assigned ASP.NET Development server port changes what happens to the details in your app.config that was generated when creating a reference to the web service? Well, it would be wrong and the test would fail. This is where Billy’s helper method comes in. Once you have created an instance of your service call, and it has loaded the config, but before you make any calls to it you need to go in and dynamically set the Endpoint address to the same address as your dynamically hosted Web Application. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Reflection; using System.ServiceModel.Description; using System.ServiceModel; namespace SSW.SQLDeploy.Test { class WcfWebServiceHelper { public static bool TryUrlRedirection(object client, TestContext context, string identifier) { bool result = true; try { PropertyInfo property = client.GetType().GetProperty("Endpoint"); string webServer = context.Properties[string.Format("AspNetDevelopmentServer.{0}", identifier)].ToString(); Uri webServerUri = new Uri(webServer); ServiceEndpoint endpoint = (ServiceEndpoint)property.GetValue(client, null); EndpointAddressBuilder builder = new EndpointAddressBuilder(endpoint.Address); builder.Uri = new Uri(endpoint.Address.Uri.OriginalString.Replace(endpoint.Address.Uri.Authority, webServerUri.Authority)); endpoint.Address = builder.ToEndpointAddress(); } catch (Exception e) { context.WriteLine(e.Message); result = false; } return result; } } } Figure: This fixes a problem with the URL in your web.config not being the same as the dynamically hosted ASP.NET Development server port. We can now add a call to this method after we created the Proxy object and change the Endpoint for the Service to the correct one. This process is wrapped in an assert as if it fails there is no point in continuing. [AspNetDevelopmentServer("WebApp1", D:\\Workspaces\\SSW\\SSW\\SqlDeploy\\DEV\\Main\\SSW.SQLDeploy.SilverlightUI.Web")] [DeploymentItem("SSW.SQLDeploy.SilverlightUI.Web.dll")] [TestMethod] public void ProfileService_Integration_SaveDefaultProjectFile_Returns_True() { ProfileServiceClient target = new ProfileServiceClient(); Assert.IsTrue(WcfWebServiceHelper.TryUrlRedirection(target, TestContext, "WebApp1")); bool isTrue = target.SaveDefaultProjectFile("Mav"); Assert.AreEqual(true, isTrue); } Figure: Editing the Endpoint from the app.config on the fly to match the dynamically hosted ASP.NET Development Server URL and port is now easy. As you can imagine AspNetDevelopmentServer poses some problems of you have multiple developers. What are the chances of everyone using the same location to store the source? What about if you are using a build server, how do you tell MSTest where to look for the files? To the rescue is a property called" “%PathToWebRoot%” which is always right on the build server. It will always point to your build drop folder for your solutions web sites. Which will be “\\tfs.ssw.com.au\BuildDrop\[BuildName]\Debug\_PrecompiledWeb\” or whatever your build drop location is. So lets change the code above to add this. [AspNetDevelopmentServer("WebApp1", "%PathToWebRoot%\\SSW.SQLDeploy.SilverlightUI.Web")] [DeploymentItem("SSW.SQLDeploy.SilverlightUI.Web.dll")] [TestMethod] public void ProfileService_Integration_SaveDefaultProjectFile_Returns_True() { ProfileServiceClient target = new ProfileServiceClient(); Assert.IsTrue(WcfWebServiceHelper.TryUrlRedirection(target, TestContext, "WebApp1")); bool isTrue = target.SaveDefaultProjectFile("Mav"); Assert.AreEqual(true, isTrue); } Figure: Adding %PathToWebRoot% to the AspNetDevelopmentServer path makes it work everywhere. Now we have another problem… this will ONLY run on the build server and will fail locally as %PathToWebRoot%’s default value is “C:\Users\[profile]\Documents\Visual Studio 2010\Projects”. Well this sucks… How do we get the test to run on any build server and any developer laptop. Open “Tools | Options | Test Tools | Test Execution” in Visual Studio and you will see a field called “Web application root directory”. This is where you override that default above. Figure: You can override the default website location for tests. In my case I would put in “D:\Workspaces\SSW\SSW\SqlDeploy\DEV\Main” and all the developers working with this branch would put in the folder that they have mapped. Can you see a problem? What is I create a “$/SSW/SqlDeploy/DEV/34567” branch from Main and I want to run tests in there. Well… I would have to change the value above. This is not ideal, but as you can put your projects anywhere on a computer, it has to be done. Conclusion Although this looks convoluted and complicated there are real problems being solved here that mean that you have a test ANYWHERE solution. Any build server, any Developer workstation. Resources: http://billwg.blogspot.com/2009/06/testing-wcf-web-services.html http://tough-to-find.blogspot.com/2008/04/testing-asmx-web-services-in-visual.html http://msdn.microsoft.com/en-us/library/ms243399(VS.100).aspx http://blogs.msdn.com/dscruggs/archive/2008/09/29/web-tests-unit-tests-the-asp-net-development-server-and-code-coverage.aspx http://www.5z5.com/News/?543f8bc8b36b174f Technorati Tags: VS2010,MSTest,Team Build 2010,Team Build,Visual Studio,Visual Studio 2010,Visual Studio ALM,Team Test,Team Test 2010

    Read the article

  • openGL ES - change the render mode from RENDERMODE_WHEN_DIRTY to RENDERMODE_CONTINUOUSLY on touch

    - by Sid
    i want to change the rendermode from RENDERMODE_WHEN_DIRTY to RENDERMODE_CONTINUOUSLY when i touch the screen. WHAT i Need : Initially the object should be stationary. after touching the screen, it should move automatically. The motion of my object is a projectile motion ans it is working fine. what i get : Force close and a NULL pointer exception. My code : public class BallThrowGLSurfaceView extends GLSurfaceView{ MyRender _renderObj; Context context; GLSurfaceView glView; public BallThrowGLSurfaceView(Context context) { super(context); // TODO Auto-generated constructor stub _renderObj = new MyRender(context); this.setRenderer(_renderObj); this.setRenderMode(RENDERMODE_WHEN_DIRTY); this.requestFocus(); this.setFocusableInTouchMode(true); glView = new GLSurfaceView(context.getApplicationContext()); } @Override public boolean onTouchEvent(MotionEvent event) { // TODO Auto-generated method stub if (event != null) { if (event.getAction() == MotionEvent.ACTION_DOWN) { if (_renderObj != null) { Log.i("renderObj", _renderObj + "lll"); // Ensure we call switchMode() on the OpenGL thread. // queueEvent() is a method of GLSurfaceView that will do this for us. queueEvent(new Runnable() { public void run() { glView.setRenderMode(RENDERMODE_CONTINUOUSLY); } }); return true; } } } return super.onTouchEvent(event); } } PS : i know that i am making some silly mistakes in this, but cannot figure out what it really is.

    Read the article

  • Oracle UCM 11g

    - by [email protected]
    Ya se ha lanzado la última versión de Oracle UCM11g. Grandes novedades, sobre todo en la arquitectura del producto, nos hacen ser muy optimistas sobre todo después de ver los resultados de rendimiento y escalabilidad obtenidos.El enlace a toda la información sobre el lanzamiento está aquí:Oracle Enterprise Content Management 11gLas novedades más importantes son:Mejor integración en tu entorno de trabajo: Nueva integración del escritorio: los contenidos se manejan usando herramientas estándares de oficina.Gestión de contenidos web en un clic: que permite a los desarrolladores y editores web acceder y actualizar contenido con un solo clic.Más funcionalidad a través de integraciones con otros productos de Oracle. Unificación del stack tecnológico de gestión de contenidosAhora Oracle ECM Suite 11g unifica todos los repositorios de contenido para facilitar su gestión en una única infraestructura.Infraestructura Oracle Fusion Middleware: Oracle ECM Suite 11g se ha trasladado completamente a la plataforma Oracle Fusion Middleware, con todas las aplicaciones soportadas por Oracle WebLogic Server y gestionado con el cuadro de mando Oracle Enterprise Manager. Rendimiento y escalabilidad ExtremosLos datos de los test de rendimiento son espectaculares corriendo en una máquina Exadata.Podéis ver un vídeo del rendimiento aquí: Bueno... 172 millones de documentos por día!!! y 124 páginas por segundo con 2 cpu's... quien quiere ser el primero en probarlo?

    Read the article

  • CodePlex Daily Summary for Wednesday, September 26, 2012

    CodePlex Daily Summary for Wednesday, September 26, 2012Popular ReleasesThe Eggbert Chronicles: Eggbert Chronicles v1: Version 1 of Eggbert Chronicles. Includes: Basic Menu System Fully-Functional Options Menu (need to auto-adjust adv. settings when preset is changed) Basic First Level (It's pre-alpha, level design isn't a must, gameplay mechanics first) 2D Movement System in a 3D World (2.5D Basically) Planned: An actual playermodel Actual custom texturing Platformer Objects: Spikes Sawblades Basic Enemies (Most likely x-axis movement) Tar pits Acid pits More puzzles Custom sound effect...D3 Loot Tracker: 1.3.1 (patch): - Magic find value will now display properly and includes follower value. - ILevel of legendary items will now display properly.WinRtBehaviors: V1.0.2: Includes simple Blend SupportMVC Bootstrap: MVC Boostrap 0.5.1: A small demo site, based on the default ASP.NET MVC 3 project template, showing off some of the features of MVC Bootstrap. This release uses Entity Framework 5 for data access and Ninject 3 for dependency injection. If you download and use this project, please give some feedback, good or bad!Windows Powershell/Quest AD account audit and reporting: Powershell AD Reporting Framework: Alpha 0.0.1 ReleasePicturethrill: Version 2.9.25.0: Allowing to run Picturethrill Update task while computer is not connected to internet on computer wake up.VCC: Latest build, v2.3.00925.0: Automatic drop of latest buildSimple PM - Project Management Simplified !: Simple Pm v1 - Aplha (Re-released): INSTALLATION GUIDE 1. Run the web setup, which will install the web app to IIS. 2. Make sure you select your application pool to "ASP.NET v4.0" during the installation. 3. Create a database named "SimplePm" 4. Run the attached database script on this database. 5. Change the database username and password in connection strings defined as SimplePmEntities and ApplicationServices from the Web.config file 6. Thats its ! Simple Pm are ready to go ! For any installation assistance feel free to c...menu4web: menu4web 1.0 - free javascript menu for web sites: menu4web 1.0 has been tested with all major browsers: Firefox, Chrome, IE, Opera and Safari. Minified m4w.js library is less than 9K. Includes 21 menu examples of different styles. Can be freely distributed under The MIT License (MIT).Rawr: Rawr 5.0.0: This is the Downloadable WPF version of Rawr!For web-based version see http://elitistjerks.com/rawr.php You can find the version notes at: http://rawr.codeplex.com/wikipage?title=VersionNotes Rawr Addon (NOT UPDATED YET FOR MOP)We now have a Rawr Official Addon for in-game exporting and importing of character data hosted on Curse. The Addon does not perform calculations like Rawr, it simply shows your exported Rawr data in wow tooltips and lets you export your character to Rawr (including ba...Coevery - Free CRM: Coevery 1.0.0.26: The zh-CN issue has been solved. We also add a project management module.EntitiesToDTOs - Entity Framework DTO Generator: EntitiesToDTOs.v3.0.Beta.2: Support for new Entity Framework EDMX (format used by VS2012) ! Support for Enum Types! DTOs and Assemblers can be generated inside project folders! Optional automatic check for updates! Support for Visual Studio 2012 !!! Choose types you want to generate! Warning system in types to generate! Added ToEntityList() and ToDTOList() to Assemblers! Indicate class identifier for DTOs and Assemblers! Cleaner Assemblers code. Ad module to support the AddIn! Lots of fixes and imp...VidCoder: 1.4.1 Beta: Updated to HandBrake 4971. This should fix some issues with stuck PGS subtitles. Fixed build break which prevented pre-compiled XML serializers from showing up. Fixed problem where a preset would get errantly marked as modified when re-opening the encode settings window or importing a new preset.SharePoint WarmUp: Nauplius.SP.Initalization: Initial release.JSLint for Visual Studio 2010: 1.4.0: VS2012 support is alphaBlackJumboDog: Ver5.7.2: 2012.09.23 Ver5.7.2 (1)InetTest?? (2)HTTP?????????????????100???????????Player Framework by Microsoft: Player Framework for Windows 8 (Preview 6): IMPORTANT: List of breaking changes from preview 5 Added separate samples download with .vsix dependencies instead of source dependencies Support for FreeWheel SmartXML ad responses Support for Smooth Streaming SDK DownloaderPlugins Support for VMAP and TTML polling for live scenarios Support for custom smooth streaming byte stream and scheme handlers Support for new play time and position tracking plugin Added IsLiveChanged event Added AdaptivePlugin.MaxBitrate property Add...WPF Application Framework (WAF): WPF Application Framework (WAF) 2.5.0.8: Version: 2.5.0.8 (Milestone 8): This release contains the source code of the WPF Application Framework (WAF) and the sample applications. Requirements .NET Framework 4.0 (The package contains a solution file for Visual Studio 2010) The unit test projects require Visual Studio 2010 Professional Changelog Legend: [B] Breaking change; [O] Marked member as obsolete WAF: Mark the class DataModel as serializable. InfoMan: Minor improvements. InfoMan: Add unit tests for all modules. Othe...LogicCircuit: LogicCircuit 2.12.9.20: Logic Circuit - is educational software for designing and simulating logic circuits. Intuitive graphical user interface, allows you to create unrestricted circuit hierarchy with multi bit buses, debug circuits behavior with oscilloscope, and navigate running circuits hierarchy. Changes of this versionToolbars on text note dialog are more flexible now. You can select font face, size, color, and background of text you are typing. RAM now can be initialized to one of the following: random va...SiteMap Editor for Microsoft Dynamics CRM 2011: SiteMap Editor (1.1.2020.421): New features: Disable a specific part of SiteMap to keep the data without displaying them in the CRM application. It simply comments XML part of the sitemap (thanks to rboyers for this feature request) Right click an item and click on "Disable" to disable it Items disabled are greyed and a suffix "- disabled" is added Right click an item and click on "Enable" to enable it Refresh list of web resources in the web resources pickerNew Projectsaftermath: Provides sse/avx implementation for matrix storage, access and basic operations, probability distributions and fast ziggurat random number generators.Agility: Agility is a management tool for the agile enterprise. It supports encourages ussage of agile methodology from portfolio and management to development.ASP.NET WebForm MVVM: MVVM for ASP.NET WebFormsAzugBeDemo: some text hereBookmark Browser: Web application that allows access to your Firefox Sync bookmarks on platforms that are not supported by Firefox (e.g. iOS).Cachalote-Todo-WPF-Skins: These are skin projects for Cachalote Todo WPF project.CodePlexDeployment01: Project set up to demonstrate codeplex deploymentColorChooser X2: comming soon...De Todo Un Poco: de todo un pcoDeals Patrol: Deals patrolEasy IP Changer: Wechseln von IP Adressen pro AdapterEasyStock: EasyStock is a small and easy to use Windows 8 app that gives you an overview of your favorite stocks with historical data for the last days, months and years. Find++: Find++ finds specific string in multiple files in a folderGoShunn: A DotNetNuke ModuleJquery DataTables Plugin c#, .NET, MS SQL Server and Webservices Example: A working example of JQuery DataTables in C#, ASP.NET, SQL Server side processing with ajax and webservices.Keywords Translator (MUI helper): MUI helper for translate words in others languages.Mupen: A Nentendo 64 Emulator. This emulator is based on the Mupen64plus code, and made to be used for learning purposes.NFC Card Demo: ??nfc?,???demo,???roboguice ioc??NJection.LambdaConverter: NJection.LambdaConverter is an assembly for converting delegates resolved from methods/constructors to expression trees. Copyright 2009-2012 Sagi FogelQuickPasteIt: QuickPasteIt is a pastebin tool for Windows and Visual Studio (2010 & 2012) which makes sharing code files and snippets as easy as one click.SharePoint Move Discussion Threads: SharePoint Move Discussion Threads solution is a tool that allows to move a thread across discussion boards within a site-collection.SQL LocalDB Wrapper: SQL LocalDB Wrapper is a .NET 3.5 assembly providing interop with the SQL LocalDB native API from managed code using .NET APIs.Study Time: Windows 8 metro style app. Create Quizzes and study card. Use the study cards either in the Windows 8 app or WP7 Companion App. Use Skydrive for storage.TenterTaobaoke: toatoaoke projaecttestddgit09252012: stestddhg0925201201: sTrigger: A DotNetNuke C# ModuleUML Creator: This is a programmering project made by 4 students from the Technical University of Denmark, and is a part of the course Windows Programming C# and .NET.W8 Ateneo Libri: No summaryWDSS-II MergedDataViewer: Quickly view merged variables map produced from w2merger Webshop for Orchard: This is Ecommerce Module to Orchard based on SkyWalker's excellent serial blogsWindows Powershell/Quest AD account audit and reporting: Powershell framework utilizing Quest Active Directory commandlet for the generation of user account, group membership and access audit reports.WinRT.Toolkit: I'm trying to Build a Charting Control Set for Windows 8 Modern UI I already Built a Pie Chart which is available now on http://blogs.msdn.com/b/mertoappsXades Library: Xades Library, currently with Xades-T capabilities and compatible with eHealth and MyCareNet.

    Read the article

  • CodePlex Daily Summary for Tuesday, July 29, 2014

    CodePlex Daily Summary for Tuesday, July 29, 2014Popular ReleasesArtezio SharePoint 2013 Workflow Activities: SharePoint Designer 2013 custom workflow actions 1.0: SharePoint Designer 2013 custom workflow actions that work with permissions. Add Role Assignment Add Role Assignments Delete Role Assignments Get Role Definition Id Get Role Definition Id By Role Type Id Reset Role Inheritance Artezio SharePoint Consulting & DevelopmentVG-Ripper & PG-Ripper: PG-Ripper 1.4.32: changes NEW: Added Support for 'ImgMega.com' links NEW: Added Support for 'ImgCandy.net' links NEW: Added Support for 'ImgPit.com' links NEW: Added Support for 'Img.yt' links FIXED: 'Radikal.ru' links FIXED: 'ImageTeam.org' links FIXED: 'ImgSee.com' links FIXED: 'Img.yt' linksAsp.Net MVC-4,Entity Framework and JQGrid Demo with Todo List WebApplication: Asp.Net MVC-4,Entity Framework and JQGrid Demo: Asp.Net MVC-4,Entity Framework and JQGrid Demo with simple Todo List WebApplication, Overview TodoList is a simple web application to create, store and modify Todo tasks to be maintained by the users, which comprises of following fields to the user (Task Name, Task Description, Severity, Target Date, Task Status). TodoList web application is created using MVC - 4 architecture, code-first Entity Framework (ORM) and Jqgrid for displaying the data.Waterfox: Waterfox 31.0 Portable: New features in Waterfox 31.0: Added support for Unicode 7.0 Experimental support for WebCL New features in Firefox 31.0:New Add the search field to the new tab page Support of Prefer:Safe http header for parental control mozilla::pkix as default certificate verifier Block malware from downloaded files Block malware from downloaded files audio/video .ogg and .pdf files handled by Firefox if no application specified Changed Removal of the CAPS infrastructure for specifying site-sp...SuperSocket, an extensible socket server framework: SuperSocket 1.6.3: The changes below are included in this release: fixed an exception when collect a server's status but it has been stopped fixed a bug that can cause an exception in case of sending data when the connection dropped already fixed the log4net missing issue for a QuickStart project fixed a warning in a QuickStart projectYnote Classic: Ynote Classic 2.8.5 Beta: Several Changes - Multiple Carets and Multiple Selections - Improved Startup Time - Improved Syntax Highlighting - Search Improvements - Shell Command - Improved StabilityDatabase Schema Reader: v1.3.4.0: Contents DatabaseSchemaReader.dll - Class library (.net3.5) DatabaseSchemaViewer.exe - UI to read and view database schemas; options to generate SQL and code; option to compare another schema CopyToSQLite/CopyToSQLite.exe - UI to copy any database schema and data to SQLite or, if installed, SQL Server CE 4.0 net4/DatabaseSchemaReader.dll - .Net 4.0 class library This Release Schema Reading (MySQL)- reads UNSIGNED integers (available in the schema model's DatabaseColumn.DbDataType prope...TEBookConverter: 1.2: Fixed: Could not start convertion in some cases Fixed: Progress show during convertion was truncated Fixed: Stopping convertion didn't reset program titleQ2Cue \\: Q2Cue v. 0.85: Initial release.CS-Script Source: Release v3.8.4: CSScript.Evaluator is migrated to Mono v3.3.0 Added aggregating //css_ignore_ns from the imported scripts cs-script.7z - CS-Script Suite (binaries, documentation, samples) cs-script.ExtensionPack.7z - CS-Script Extension Pack (additional binaries and samples) cs-scriptDocs.7z - CS-Script DocumentationDotSpatial: DotSpatial 1.7: DotSpatial.Full - includes all DotSpatial libraries, extensions and DemoMap application DotSpatial.Core - includes only DotSpatial core libraries Entire list of changes see in the issue tracker. Main changes: Improved common stability, optimized memory and speed when loading and rendering shapefiles, fixed some memory leaks in rasters and shape layers. Simplified plugin infrastructure. Now there are predefined implementations for all required components (IStatusControl, IDockManager, IHead...NRepository: NRepository 2.2: NuGetNRepository packages are available from NuGet.org: NRepository.Core: Install-Package NRepository.Core NRepository.EntityFramework: Install-Package NRepository.EntityFramework NRepository.TestKit: Install-Package NRepository.TestKit Contoso University Sample Projects Added 3 versions of Contoso University sample code added: ContosoUniversityOriginal - This is the original Microsoft sample project for Entity Framework. ContosoUniversityUsingNRepository - This version simply repl...InstagramSaver: 1.5: Added: An option to wait between downloads to prevent ban from server Improved: File downloading performance Improved: File checking performancePVReportDeployer: PVReportDeployer 1.0: PVReportDeployer 1.0AD4 Application Designer for flow based .NET applications: AD4.AppDesigner.23.20: AD4.Iteration.23.20(Advanced Rendering Features) Option to render name of flow pins within flow chart (AlarmClockSample.10.ad4 used to test this extension): MainWindow extended by adding FlowChartShowFlowPinCaptionsComboBox ConfigureUIControls customized ManageFlowChartShowFlowPinCaptionsOptionFlow customized Parameter FlowChartFlowPins replaced FlowChartFlowPinCaptions in AD4.AppDesigner.cfg RenderFlowPinsCaptions customized to use the parameter ToDo: Some tutorials are unfinished b...CRM 2013 One Click Navigation: CRM2013OneClickNavigation_1_0_0_3_managed.zip: Fixes on Security PrivilegesAutomatedLab: AutomatedLab 2.1.0.0: 2.1.0 Support for external virtual switches CaRoot is a new role for installing Root Certificate Authorities Root domain controllers are installed in parallel now 2.0.0 Now supports also Windows Server 2008 R2 and 7 No longer the limit of just having one client and one server operating system Rewrite of the code that handles VHDs Lots of bug fixing Changed that parameter definition of some cmdlets in AutomatedLabDefinition and also adapted the sample scripts Now the Forest...BizTalk Deployment Utilities: 1.0.0.0: Draft VersionGroupMe Software Development Kit: GroupMe .NET SDK v1.0.1: Small update concerning the /users/me endpoint to get the currently authenticated user info. Documentation is available here: http://dotnetcorner.ch/Projects/GroupMe-NET-SDK/DocumentationOneNote Tagging Kit: OneNoteTaggingKit Add-In 2.4.5316.33833: New Features in this ReleaseThe Find Pages dialog preserves search string and tag filter selection on search scope changes Other ChangesDialog windows restored when action button is pressed while windows is minimized Code cleanup and simplification Code documentation Created some reusable UI controls Tags styling made more pleasant (I hope) Tag tooltips improved on the Find Pages dialog : Added dedicated tooltips to the page count and selection indicator of tags Closing open dial...New ProjectsCognitum ASP.NET Providers for Cassandra: Cassandra Providers is a ASP.NET solution that uses the Cassandra Database data source for a custom Membership, Role, Profile, an Session-State providers.DG Mobile: Simples aplicação para inserção, visualização e emissão de relatório de atividades relacionadas ao DG.Dynamics AX Development tools: Several AX Development related tools combined into one configurable packages: TFS Workspace, DEV_Tools, and X++ Editor components.E Drawing Library for WinRT: E Drawing Library for WinRT lets you create graphic rich Windows Store Apps easily, giving you all the power of Direct2D with simple classes and methods.EFramework.DataAccess: Summary ????freetalkserver: This php server, user can register!gicon: gicon is a project to help you to generate avatar/icon by hash (MD5, SHA1) or random hex string (such as GUID)hOOt - Full text search: Full text search engine built from scratch using bitmap indexesMelodyUI - Library for HTML, CSS & JS Development: MelodyUI is a set of classes and helpers that let us to create Web Applications. MelodyUI is lightweight and don't have any dependency.nRF24L01Plus .NETMF driver: nRF24L01, .NET MFNyan: Beginning...Prince Game Xna: Prince of Persia Net Game in Xna Game StudioSmartsby: Combining several small business web app's information into a single dashboard.Super snippets: Super snippets para Visual StudioTCP/IP Adapter BizTalk 2013: BizTalk 2013 TCP/IP community adapter. This is an updated version of the TCP/IP adapter for BizTalk, for use with BizTalk 2013.testMercurial: summaryUnit OF Work With Sql Helper: This project is intended to provide a simple data access object for SQL Server with repository and Unit of Work pattern.VisualRegEx: Prototype. Experimenting regex parsing, graph layout, etc.WDK Hardware Development Boards Add-On: Scripts for working with windows compatible hardware development boards like the Sharks Cove?????? 2014????????: ???????????????、????、????、??????、????、????????,????????、?????????,?????。?????? 2014????????: ????????????,????,??????????? ???? ???? ?????????,???,??,?????!???? 2014????????: ?????????????、????、????、??????、????、???????,?????,?????????!????? 2014???????: ????????????????,?????????????。????????????,???????,???????,?????,?????????? 2014????????: ?????????????????、????、??????、????????,????????????,???????????!??????? 2014???????: ??????????????????,??????????????、???????、???????、???????、?????!??????? 2014????????: ?????????????????????,????????????????,????????????????,??????!????? 2014????????: ?????????????????????????,???????????,????????,??????????????????????????? 2014????????: ??????????????????????,????“???????,???????”?????,????????????!?????? 2014???????: ?????????????????,????,????,??????,????“????、????、????、????”????????,??????.?????? 2014????????: ?????????????????"????,????"???,????????????????????????,??????????????。?????? 2014????????: ??????????????:????,????,????,???????,????????,??????:????????,?????!???? 2014????????: ????????????????????????,???????????????,????????????????!???? 2014?????????: ??????????????????,?????????????,???????????.????????????,????????????!?????? 2014??????: ??????????????:????,????,????,???????,????????,??????:????????,?????!?????? 2014??????: ?????????????????,???????????????。?????????????,???????,?????????。????? 2014???????: ????????????????"????,????"???,????????????????????????,??????????????。????? 2014??????: ???????????????????,?????????????,???????????.????????????,????????????!????? 2014???????: ?????????????????????????,???????????????,????????????????!?????? ????????: ??????????????300??,????????、???????、????、????????、?????,??????:????,????,???????!?????? ????????: ??????????????????,?????,???,???、???、?????,???,?????,??????????????????? ???????????: ??????????????????,?????????。????????????,??????,????,????,?????????!????? ???????: ????????????????????????,?????、???、????,????,???、???、???、???、???,????,?????!????? ???????: ????????????????????,????????,????????,????,????,??????,???????!????? ???????: ???????????????,??????????????????,????????,??????????????、????。?????? 2014????????: ????????????????????,????????:??、??、???,?????????????????????!?????? ????????: ????????????????6?,???????????????????????????,??????????????,?????????!?????? ??????: ????????????????8?,????????,????????,??????????,?????,????? ,????????!?????? ???????: ?????????????????????????????、????、????、???????????,????,????!????? 2014???????: ???????????、???、??、??????????????????????????????,????????????????!?????? 2014????????: ????????????????????????、??????,????、?????、????, ?????????,?????????????!?????? ????????: ?????????????????????、????、????、??????、???????,??????、??????。?????? ???????: ??????????????????,???????、????、????、??????、???????,??????,???????????。???? ????????: ??????,??????,?????????????????????,???????????????????????。???? ???????: ??????????????,???????、???????????,????????,????,?????????,??????,??????!?????? ????????: ?????????????????,?????????????。?????????,???????,???????,?????????????。?????? ????????: ????????????????、??????、??????、??????、??????、?????、??????、????、????、????????!????? ???????: ???????????????????,??????????????,???????????,??????,????,??????,??????。????? ???????: ?????????????!???????????,??????,????,?????????????,????????,??????,????,?????...?????? ???????: ????????????、??、???????????,??????,????????,??????????????????...?????????? ????????: ??????????????,??????????????,?????????,????,????,??????。???? ?????: ????????????、?????????,?????????,????,????????,????????????????!????? 2014??????????: ???????????????????,?????,???????,???????????,??????! ????? 2014?????????: ???????????????????,?????????????????????,?????,????,???????.

    Read the article

  • Google Top Geek E04

    Google Top Geek E04 In Spanish! Google Top Geek is a weekly show from Google Mexico. This week: 1. Esto es Google, el evento más grande e importante de Google en México, en su segunda edición, se llevó a cabo los días 13 y 14 de noviembre de 2012. Fue un gran evento dirigido a todo el ecosistema en México: desarrolladores, usuarios y negocios. Cerca de 3000 asistentes nos honraron con su presencia en Esto es Google a lo largo de dos intensos días, llenos de conferencias, paneles y espacios para conocer y acercarse a tecnología y startups. Mencionamos durante este segmento, ligas para aprender más de la importancia del mercado de móviles en México y el mundo: Go Mobile, para pasar tu sitio actual a una versión para móviles. The Mobile Playbook, con mucha información para tomar las mejores decisiones con respecto a móviles y tecnologías modernas. 2. De concursos de programación, de negocios hasta internships y trabajo de tiempo completo, Google ofrece una amplia gama de oportunidades en todo el mundo. por ejemplo, está por iniciar el concurso Google Code-in 2012, para chavos de preparatoria, con un formato similar al de Google summer of code, con 10 organizaciones de código abierto como mentoras. 3. Lanzamientos de la semana, el primero interesante para Gmail: búsquedas por tamaño, utilizando size:5m, larger: .., fechas flexibles, etc. En Google Drive ya puedes buscar por persona, no sólo los que han compartido contigo; sino los que involucran a una misma persona. Búsquedas de la semana Las <b>...</b> From: GoogleDevelopers Views: 15 2 ratings Time: 15:50 More in Science & Technology

    Read the article

  • Vertex fog producing black artifacts

    - by Nick
    I originally posted this question on the XNA forums but got no replies, so maybe someone here can help: I am rendering a textured model using the XNA BasicEffect. When I enable fog, the model outline is still visible as many small black dots when it should be "in the fog". Why is this happening? Here's what it looks like for me -- http://tinypic.com/r/fnh440/6 Here is a minimal example showing my problem: (the ship model that this example uses is from the chase camera sample on this site -- http://xbox.create.msdn.com/en-US/education/catalog/sample/chasecamera -- in case anyone wants to try it out ;)) public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; Model model; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here model = Content.Load<Model>("ship"); foreach (ModelMesh mesh in model.Meshes) { foreach (BasicEffect be in mesh.Effects) { be.EnableDefaultLighting(); be.FogEnabled = true; be.FogColor = Color.CornflowerBlue.ToVector3(); be.FogStart = 10; be.FogEnd = 30; } } } protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here model.Draw(Matrix.Identity * Matrix.CreateScale(0.01f) * Matrix.CreateRotationY(3 * MathHelper.PiOver4), Matrix.CreateLookAt(new Vector3(0, 0, 30), Vector3.Zero, Vector3.Up), Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, 16f/9f, 1, 100)); base.Draw(gameTime); } }

    Read the article

  • Google Top Geek E05

    Google Top Geek E05 In Spanish! Google Top Geek (GTG) es un show semanal que generamos desde México con noticias, las tendencias en búsquedas y YouTube en América Latina, así como referencias a apps y eventos interesantes. GTG se transmite los lunes al medio día, 12 pm, desde Google Developers Live. Guión del programa Esta semana 1. Geeks interactuando y socializando en el mundo real, eso justamente es lo que ha logrado el juego masivo Ingress que liberó Google recientemente. Tienen que escoger un bando: resistance o enlightened, el proyecto Niantic. Campos de energía, elementos, intriga, combate, ... Y lo mejor de todo: mucha diversión. Cuando obtengan su código, si están del lado correcto, pueden encontrarnos en Ingress Enlightened Latin America +page en Google+. 2. Reality show para desarrolladores en Argentina: +Next Level, 40 estudiantes y profesionales de TI trabajarán siete días con cámaras todo el tiempo, expertos de toda América Latina via Google Hangouts... Del 26 de noviembre al 2 de diciembre, en la ciudad de Tandil. 3. Google Apps for Business Un tema relativamente nuevo en el mundo empresarial en nuestra región es la nube y cómo aprovecharla mejor. Google Apps for Business es un servicio basado en la nube que provee Mensajería y Colaboración a través de los productos que todos conocemos de Google pero con el nivel de controles y auditoría que requieren las empresas. El enfoque de Google es y siempre ha sido la satisfacción de nuestros usuarios y Google Apps for Business le <b>...</b> From: GoogleDevelopers Views: 1 0 ratings Time: 15:39 More in Science & Technology

    Read the article

  • Pixel Shader Issues :

    - by Morphex
    I have issues with a pixel shader, my issue is mostly that I get nothing draw on the screen. float4x4 MVP; // TODO: add effect parameters here. struct VertexShaderInput { float4 Position : POSITION; float4 normal : NORMAL; float2 TEXCOORD : TEXCOORD; }; struct VertexShaderOutput { float4 Position : POSITION; }; VertexShaderOutput VertexShaderFunction(VertexShaderInput input) { input.Position.w = 0; VertexShaderOutput output; output.Position = mul(input.Position, MVP); // TODO: add your vertex shader code here. return output; } float4 PixelShaderFunction(VertexShaderOutput input) : SV_TARGET { return float4(1, 0, 0, 1); } technique { pass { Profile = 11.0; VertexShader = VertexShaderFunction; PixelShader = PixelShaderFunction; } } My matrix is calculated like this : Matrix MVP = Matrix.Multiply(Matrix.Multiply(Matrix.Identity, Matrix.LookAtLH(new Vector3(-10, 10, -10), new Vector3(0), new Vector3(0, 1, -0))), Camera.Projection); VoxelEffect.Parameters["MVP"].SetValue(MVP); Visual Studio Graphics Debug shows me that my vertex shader is actually working, but not the PixelShader. I striped the Shader to the bare minimums so that I was sure the shader was correct. But why is my screen still black?

    Read the article

  • Spring security - Reach users ID without passing it through every controller

    - by nilsi
    I have a design issue that I don't know how to solve. I'm using Spring 3.2.4 and Spring security 3.1.4. I have a Account table in my database that looks like this: create table Account (id identity, username varchar unique, password varchar not null, firstName varchar not null, lastName varchar not null, university varchar not null, primary key (id)); Until recently my username was just only a username but I changed it to be the email address instead since many users want to login with that instead. I have a header that I include on all my pages which got a link to the users profile like this: <a href="/project/users/<%= request.getUserPrincipal().getName()%>" class="navbar-link"><strong><%= request.getUserPrincipal().getName()%></strong></a> The problem is that <%= request.getUserPrincipal().getName()%> returns the email now, I don't want to link the user's with thier emails. Instead I want to use the id every user have to link to the profile. How do I reach the users id's from every page? I have been thinking of two solutions but I'm not sure: Change the principal to contain the id as well, don't know how to do this and having problem finding good information on the topic. Add a model attribute to all my controllers that contain the whole user but this would be really ugly, like this. Account account = entityManager.find(Account.class, email); model.addAttribute("account", account); There are more way's as well and I have no clue which one is to prefer. I hope it's clear enough and thank you for any help on this. ====== Edit according to answer ======= I edited Account to implement UserDetails, it now looks like this (will fix the auto generated stuff later): @Entity @Table(name="Account") public class Account implements UserDetails { @Id private int id; private String username; private String password; private String firstName; private String lastName; @ManyToOne private University university; public Account() { } public Account(String username, String password, String firstName, String lastName, University university) { this.username = username; this.password = password; this.firstName = firstName; this.lastName = lastName; this.university = university; } public String getUsername() { return username; } public String getPassword() { return password; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public void setUsername(String username) { this.username = username; } public void setPassword(String password) { this.password = password; } public void setFirstName(String firstName) { this.firstName = firstName; } public void setLastName(String lastName) { this.lastName = lastName; } public University getUniversity() { return university; } public void setUniversity(University university) { this.university = university; } public int getId() { return id; } public void setId(int id) { this.id = id; } @Override public Collection<? extends GrantedAuthority> getAuthorities() { // TODO Auto-generated method stub return null; } @Override public boolean isAccountNonExpired() { // TODO Auto-generated method stub return false; } @Override public boolean isAccountNonLocked() { // TODO Auto-generated method stub return false; } @Override public boolean isCredentialsNonExpired() { // TODO Auto-generated method stub return false; } @Override public boolean isEnabled() { // TODO Auto-generated method stub return true; } } I also added <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> To my jsp files and trying to reach the id by <sec:authentication property="principal.id" /> This gives me the following org.springframework.beans.NotReadablePropertyException: Invalid property 'principal.id' of bean class [org.springframework.security.authentication.UsernamePasswordAuthenticationToken]: Bean property 'principal.id' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? ====== Edit 2 according to answer ======= I based my application on spring social samples and I never had to change anything until now. This are the files I think are relevant, please tell me if theres something you need to see besides this. AccountRepository.java public interface AccountRepository { void createAccount(Account account) throws UsernameAlreadyInUseException; Account findAccountByUsername(String username); } JdbcAccountRepository.java @Repository public class JdbcAccountRepository implements AccountRepository { private final JdbcTemplate jdbcTemplate; private final PasswordEncoder passwordEncoder; @Inject public JdbcAccountRepository(JdbcTemplate jdbcTemplate, PasswordEncoder passwordEncoder) { this.jdbcTemplate = jdbcTemplate; this.passwordEncoder = passwordEncoder; } @Transactional public void createAccount(Account user) throws UsernameAlreadyInUseException { try { jdbcTemplate.update( "insert into Account (firstName, lastName, username, university, password) values (?, ?, ?, ?, ?)", user.getFirstName(), user.getLastName(), user.getUsername(), user.getUniversity(), passwordEncoder.encode(user.getPassword())); } catch (DuplicateKeyException e) { throw new UsernameAlreadyInUseException(user.getUsername()); } } public Account findAccountByUsername(String username) { return jdbcTemplate.queryForObject("select username, firstName, lastName, university from Account where username = ?", new RowMapper<Account>() { public Account mapRow(ResultSet rs, int rowNum) throws SQLException { return new Account(rs.getString("username"), null, rs.getString("firstName"), rs.getString("lastName"), new University("test")); } }, username); } } security.xml <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> <http pattern="/resources/**" security="none" /> <http pattern="/project/" security="none" /> <http use-expressions="true"> <!-- Authentication policy --> <form-login login-page="/signin" login-processing-url="/signin/authenticate" authentication-failure-url="/signin?error=bad_credentials" /> <logout logout-url="/signout" delete-cookies="JSESSIONID" /> <intercept-url pattern="/addcourse" access="isAuthenticated()" /> <intercept-url pattern="/courses/**/**/edit" access="isAuthenticated()" /> <intercept-url pattern="/users/**/edit" access="isAuthenticated()" /> </http> <authentication-manager alias="authenticationManager"> <authentication-provider> <password-encoder ref="passwordEncoder" /> <jdbc-user-service data-source-ref="dataSource" users-by-username-query="select username, password, true from Account where username = ?" authorities-by-username-query="select username, 'ROLE_USER' from Account where username = ?"/> </authentication-provider> <authentication-provider> <user-service> <user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" /> </user-service> </authentication-provider> </authentication-manager> </beans:beans> And this is my try of implementing a UserDetailsService public class RepositoryUserDetailsService implements UserDetailsService { private final AccountRepository accountRepository; @Autowired public RepositoryUserDetailsService(AccountRepository repository) { this.accountRepository = repository; } @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { Account user = accountRepository.findAccountByUsername(username); if (user == null) { throw new UsernameNotFoundException("No user found with username: " + username); } return user; } } Still gives me the same error, do I need to add the UserDetailsService somewhere? This is starting to be something else compared to my initial question, I should maybe start another question. Sorry for my lack of experience in this. I have to read up.

    Read the article

  • Day 4 - Game Sprites In Action

    - by dapostolov
    Yesterday I drew an image on the screen. Most exciting, but ... I spent more time blogging about it then actual coding. So this next little while I'm going to streamline my game and research and simply post key notes. Quick notes on the last session: The most important thing I wanted to point out were the following methods:           spriteBatch.Begin(SpriteBlendMode.AlphaBlend);           spriteBatch.Draw(sprite, position, Color.White);           spriteBatch.End(); The spriteBatch object is used to draw Textures and a 2D texture is called a Sprite A texture is generally an image, which is called an Asset in XNA The Draw Method in the Game1.cs is looped (until exit) and utilises the spriteBatch object to draw a Scene To begin drawing a Scene you call the Begin Method. To end a Scene you call the End Method. And to place an image on the Scene you call the Draw method. The most simple implementation of the draw method is:           spriteBatch.Draw(sprite, position, Color.White); 1) sprite - the 2D texture you loaded to draw 2) position - the 2d vector, a set of x & y coordinates 3) Color.White - the tint to apply to the texture, in this case, white light = nothing, nada, no tint. Game Sprites In Action! Today, I played around with Draw methods to get comfortable with their "quirks". The following is an example of the above draw method, but with more parameters available for us to use. Let's investigate!             spriteBatch.Draw(sprite, position2, null, Color.White, MathHelper.ToRadians(45.0f), new Vector2(sprite.Width / 2, sprite.Height / 2), 1.0F, SpriteEffects.None, 0.0F); The parameters (in order): 1) sprite  the texture to display 2) position2 the position on the screen / scene this can also be a rectangle 3) null the portion of the image to display within an image null = display full image this is generally used for animation strips / grids (more on this below) 4) Color.White Texture tinting White = no tint 5) MathHelper.ToRadians(45.0f) rotation of the object, in this case 45 degrees rotates from the set plotting point. 6) new Vector(0,0) the plotting point in this case the top left corner the image will rotate from the top left of the texture in the code above, the point is set to the middle of the image. 7) 1.0f Image scaling (1x) 8) SpriteEffects.None you can flip the image horizontally or vertically 9) 0.0f The z index of the image. 0 = closer, 1 behind? And playing around with different combinations I was able to come up with the following whacky display:   Checking off Yesterdays Intention List: learn game development terminology (in progress) - We learned sprite, scene, texture, and asset. how to place and position (rotate) a static image on the screen (completed) - The thing to note was, it's was in radians and I found a cool helper method to convert degrees into radians. Also, the image rotates from it's specified point. how to layer static images on the screen (completed) - I couldn't seem to get the zIndex working, but one things for sure, the order you draw the image in also determines how it is rendered on the screen. understand image scaling (in progress) - I'm not sure I have this fully covered, but for the most part plug a number in the scaling field and the image grows / shrinks accordingly. can we reuse images? (completed) - yes, I loaded one image and plotted the bugger all over the screen. understand how framerate is handled in XNA (in progress) - I hacked together some code to display the framerate each second. A framerate of 60 appears to be the standard. Interesting to note, the GameTime object does provide you with some cool timing capabilities, such as...is the game running slow? Need to investigate this down the road. how to display text , basic shapes, and colors on the screen (in progress) - i got text rendered on the screen, and i understand containing rectangles. However, I didn't display "shapes" & "colors" how to interact with an image (collision of user input?) (todo) how to animate an image and understand basic animation techniques (in progress) - I was able to create a stripe animation of numbers ranging from 1 - 4, each block was 40 x 40 pixles for a total stripe size of 160 x 40. Using the portion (source Rectangle) parameter, i limited this display to each section at varying intervals. It was interesting to note my first implementation animated at rocket speed. I then tried to create a smoother animation by limiting the redraw capacity, which seemed to work. I guess a little more research will have to be put into this for animating characters / scenes. how to detect colliding images or screen edges (todo) - but the rectangle object can detect collisions I believe. how to manipulate the image, lets say colors, stretching (in progress) - I haven't figured out how to modify a specific color to be another color, but the tinting parameter definately could be used. As for stretching, use the rectangle object as the positioning and the image will stretch to fit! how to focus on a segment of an image...like only displaying a frame on a film reel (completed) - as per basic animation techniques what's the best way to manage images (compression, storage, location, prevent artwork theft, etc.) (todo) Tomorrows Intention Tomorrow I am going to take a stab at rendering a game menu and from there I'm going to investigate how I can improve upon the code and techniques. Intention List: Render a menu, fancy or not Show the mouse cursor Hook up click event A basic animation of somesort Investigate image / menu techniques D.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >