PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
11,430,668
07/11/2012 10:28:11
1,177,897
01/30/2012 11:06:01
147
11
Storing private data in jQuery widget, really private?
I search some time in the web to find a way to store data inside my widget, that can't be damaged or misused. Most I found the recommendation to use this inside the widget. <!-- language: lang-js --> _init: function() { this._internalData = {}; }, But this data is not internal :( <!-- language: lang-js --> console.log($("#View1").JSTreeTable("").data().JSTreeTable._internalData); The above code gives full access to the internal data. Is there another way? Regards
jquery
jquery-widgets
null
null
null
null
open
Storing private data in jQuery widget, really private? === I search some time in the web to find a way to store data inside my widget, that can't be damaged or misused. Most I found the recommendation to use this inside the widget. <!-- language: lang-js --> _init: function() { this._internalData = {}; }, But this data is not internal :( <!-- language: lang-js --> console.log($("#View1").JSTreeTable("").data().JSTreeTable._internalData); The above code gives full access to the internal data. Is there another way? Regards
0
11,430,669
07/11/2012 10:28:13
294,661
03/16/2010 10:47:41
1,154
38
iOS – UILocalNotification fired twice for same notification
If I schedule two `UILocalNotification`s and set them both to fire at the exact same fireDate. Then on the device (this is not the simulator bug) on the fireDate the `application:didReceiveLocalNotification:` will fire 4 times (2 times for each notification). Is this a known bug? Because I have not been able to find any information about it.
ios
uilocalnotification
null
null
null
null
open
iOS – UILocalNotification fired twice for same notification === If I schedule two `UILocalNotification`s and set them both to fire at the exact same fireDate. Then on the device (this is not the simulator bug) on the fireDate the `application:didReceiveLocalNotification:` will fire 4 times (2 times for each notification). Is this a known bug? Because I have not been able to find any information about it.
0
11,430,670
07/11/2012 10:28:22
1,433,826
06/03/2012 17:27:11
41
2
ListView containing checkbox scrolling issue
I am trying to create a `ListView` containing directory name. The `ListView` contains a `TextView` to display the Folder name and a `checkbox`. The List is created successfully but I'm facing the problem with state of the checkbox when I scroll the list up/down. The states of the checkboxes changes randomly. To save the state of the checkboxes I'm using a `HashMap<String, Boolean>,` String continig the name of the directory and boolean - the checkbox state. Below is the code (Sorry for the length): MainActivity.java public class MainActivity extends ListActivity implements OnClickListener { Button done, cancel, selectAll; ArrayList<String> m_list; HashMap<String, Boolean> m_checkedMap; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); m_checkedMap = new HashMap<String, Boolean>(); done = (Button) findViewById(R.id.bDone); cancel = (Button) findViewById(R.id.bCancel); selectAll = (Button) findViewById(R.id.bSelAll); done.setOnClickListener(this); cancel.setOnClickListener(this); new AsyncHandler(this).execute(); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); Toast.makeText(this, m_list.get(position), Toast.LENGTH_SHORT).show(); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.bDone: //Update CheckedMap in DB Toast.makeText(this, m_checkedMap.values().toString(), Toast.LENGTH_LONG).show(); break; case R.id.bCancel: this.finish(); break; } } public class AsyncHandler extends AsyncTask { Context context; public AsyncHandler(Context c) { context = c; } @Override protected void onPreExecute() { super.onPreExecute(); Toast.makeText(context, "In onPreExecute()", Toast.LENGTH_SHORT) .show(); } @Override protected Object doInBackground(Object... arg0) { getList(); return null; } @Override protected void onPostExecute(Object result) { // super.onPostExecute(result); setListAdapter(new ElementAdapter(context, m_list, m_checkedMap)); } private void getList() { m_list = new ArrayList<String>(); File root = new File("/"); File[] files = root.listFiles(); for (File f : files) { if (f.isDirectory() && !f.isHidden()) { m_list.add(f.getName()); m_checkedMap.put(f.getName(), false); } } Collections.sort(m_list); } } } Adapter class public class ElementAdapter extends ArrayAdapter { LinearLayout rowLayout; ArrayList<String> items = new ArrayList<String>(); TextView tvElement; HashMap<String, Boolean> checkedMap; CheckBox cBox; Context context; public ElementAdapter(Context c, ArrayList<String> elements, HashMap<String, Boolean> m_checkedMap) { super(c, R.layout.row, elements); this.items = elements; this.checkedMap = m_checkedMap; this.context = c; } @Override public View getView(final int position, View convertView, ViewGroup parent) { View view = convertView; if (view == null) { LayoutInflater vi = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = vi.inflate(R.layout.row, null); } rowLayout = (LinearLayout) view.findViewById(R.id.row); tvElement = (TextView) view.findViewById(R.id.tvElement); tvElement.setText(items.get(position)); cBox = (CheckBox) view.findViewById(R.id.checkBox1); cBox.setOnClickListener(new OnClickListener() { public void onClick(View paramView) { if (cBox.isChecked()) { //checkedMap.put(tvElement.getText().toString(), false); checkedMap.put(items.get(position), false); } else if (!cBox.isChecked()) { //checkedMap.put(tvElement.getText().toString(), true); checkedMap.put(items.get(position), true); } } }); cBox.setChecked(checkedMap.get(items.get(position))); return view; } }
java
android
android-listview
android-checkbox
null
null
open
ListView containing checkbox scrolling issue === I am trying to create a `ListView` containing directory name. The `ListView` contains a `TextView` to display the Folder name and a `checkbox`. The List is created successfully but I'm facing the problem with state of the checkbox when I scroll the list up/down. The states of the checkboxes changes randomly. To save the state of the checkboxes I'm using a `HashMap<String, Boolean>,` String continig the name of the directory and boolean - the checkbox state. Below is the code (Sorry for the length): MainActivity.java public class MainActivity extends ListActivity implements OnClickListener { Button done, cancel, selectAll; ArrayList<String> m_list; HashMap<String, Boolean> m_checkedMap; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); m_checkedMap = new HashMap<String, Boolean>(); done = (Button) findViewById(R.id.bDone); cancel = (Button) findViewById(R.id.bCancel); selectAll = (Button) findViewById(R.id.bSelAll); done.setOnClickListener(this); cancel.setOnClickListener(this); new AsyncHandler(this).execute(); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); Toast.makeText(this, m_list.get(position), Toast.LENGTH_SHORT).show(); } @Override public void onClick(View view) { switch (view.getId()) { case R.id.bDone: //Update CheckedMap in DB Toast.makeText(this, m_checkedMap.values().toString(), Toast.LENGTH_LONG).show(); break; case R.id.bCancel: this.finish(); break; } } public class AsyncHandler extends AsyncTask { Context context; public AsyncHandler(Context c) { context = c; } @Override protected void onPreExecute() { super.onPreExecute(); Toast.makeText(context, "In onPreExecute()", Toast.LENGTH_SHORT) .show(); } @Override protected Object doInBackground(Object... arg0) { getList(); return null; } @Override protected void onPostExecute(Object result) { // super.onPostExecute(result); setListAdapter(new ElementAdapter(context, m_list, m_checkedMap)); } private void getList() { m_list = new ArrayList<String>(); File root = new File("/"); File[] files = root.listFiles(); for (File f : files) { if (f.isDirectory() && !f.isHidden()) { m_list.add(f.getName()); m_checkedMap.put(f.getName(), false); } } Collections.sort(m_list); } } } Adapter class public class ElementAdapter extends ArrayAdapter { LinearLayout rowLayout; ArrayList<String> items = new ArrayList<String>(); TextView tvElement; HashMap<String, Boolean> checkedMap; CheckBox cBox; Context context; public ElementAdapter(Context c, ArrayList<String> elements, HashMap<String, Boolean> m_checkedMap) { super(c, R.layout.row, elements); this.items = elements; this.checkedMap = m_checkedMap; this.context = c; } @Override public View getView(final int position, View convertView, ViewGroup parent) { View view = convertView; if (view == null) { LayoutInflater vi = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = vi.inflate(R.layout.row, null); } rowLayout = (LinearLayout) view.findViewById(R.id.row); tvElement = (TextView) view.findViewById(R.id.tvElement); tvElement.setText(items.get(position)); cBox = (CheckBox) view.findViewById(R.id.checkBox1); cBox.setOnClickListener(new OnClickListener() { public void onClick(View paramView) { if (cBox.isChecked()) { //checkedMap.put(tvElement.getText().toString(), false); checkedMap.put(items.get(position), false); } else if (!cBox.isChecked()) { //checkedMap.put(tvElement.getText().toString(), true); checkedMap.put(items.get(position), true); } } }); cBox.setChecked(checkedMap.get(items.get(position))); return view; } }
0
11,430,672
07/11/2012 10:28:26
996,809
10/15/2011 11:54:08
37
6
JavaScript - how to check if event already added
I want to add an listener exactly once for `beforeunload`. This is my pseudocode: if(window.hasEventListener('beforeunload') === false) { window.addEventListener('beforeunload', function() { ... }, false); } But `hasEventListener` does not exist obviously. How can I achieve this? Thanks.
javascript
eventlistener
null
null
null
null
open
JavaScript - how to check if event already added === I want to add an listener exactly once for `beforeunload`. This is my pseudocode: if(window.hasEventListener('beforeunload') === false) { window.addEventListener('beforeunload', function() { ... }, false); } But `hasEventListener` does not exist obviously. How can I achieve this? Thanks.
0
11,430,676
07/11/2012 10:28:32
1,516,844
07/11/2012 06:40:45
1
0
post array empty submit
Hi I am trying to submit a form but when I do: var_dump($_POST); I get: Array(0) { } <form action="avvikelse.php" method="POST" /> <p>Operation step: <input type="int" name"operation_step" /></p> <p>Problem detail: <input type="text" name"problem_detail" /></p> <input type="submit" value="Submit" /> </form> Why? Thank you!
php
mysql
html
submit
null
null
open
post array empty submit === Hi I am trying to submit a form but when I do: var_dump($_POST); I get: Array(0) { } <form action="avvikelse.php" method="POST" /> <p>Operation step: <input type="int" name"operation_step" /></p> <p>Problem detail: <input type="text" name"problem_detail" /></p> <input type="submit" value="Submit" /> </form> Why? Thank you!
0
11,430,678
07/11/2012 10:28:36
616,172
02/14/2011 12:22:24
271
3
ASP.Net MVC Get QueryString Value using JQuery
I am developing an ASP.Net MVC 3 Web Application. I have a Razor View which enables the User to Create a new entry in the database. Within this Create View, there is a Drop Down List and when the User selects an option the following JQuery code fires $(document).ready(function () { $("#gradeID").change(ChangeEventOfDDL); function ChangeEventOfDDL() { var dropDownValue = $('#gradeID').val(); //alert(dropDownValue); $.ajax({ type: "POST", url: '/FormEmployment/CreateSpecialtiesPartialView/' + dropDownValue, success: function (data) { $('#SpecialtiesContent').html(data); } }); } }); As you can see within this code I retrieve the selected Drop Down List value using var dropDownValue = $('#gradeID').val(); When a User is Editing an entry, I wish to fire off a similar piece of code, only this time I would like to retrieve the entry ID in the QueryString which will look something like this http://localhost:56354/FormEmployment/Edit/41 Does anyone know how I can get the value 41 using JQuery or is this even possible? Thanks for your help. Tony.
jquery
asp.net-mvc-3
query-string
null
null
null
open
ASP.Net MVC Get QueryString Value using JQuery === I am developing an ASP.Net MVC 3 Web Application. I have a Razor View which enables the User to Create a new entry in the database. Within this Create View, there is a Drop Down List and when the User selects an option the following JQuery code fires $(document).ready(function () { $("#gradeID").change(ChangeEventOfDDL); function ChangeEventOfDDL() { var dropDownValue = $('#gradeID').val(); //alert(dropDownValue); $.ajax({ type: "POST", url: '/FormEmployment/CreateSpecialtiesPartialView/' + dropDownValue, success: function (data) { $('#SpecialtiesContent').html(data); } }); } }); As you can see within this code I retrieve the selected Drop Down List value using var dropDownValue = $('#gradeID').val(); When a User is Editing an entry, I wish to fire off a similar piece of code, only this time I would like to retrieve the entry ID in the QueryString which will look something like this http://localhost:56354/FormEmployment/Edit/41 Does anyone know how I can get the value 41 using JQuery or is this even possible? Thanks for your help. Tony.
0
11,430,680
07/11/2012 10:28:49
1,516,788
07/11/2012 06:12:25
1
0
script conflict
I have 5 scripts on my page and I’d like to add them altogther but am not too sure how. The first is <script type="text/javascript"><!--//--><![CDATA[//><!-- sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); //--><!]]> </script> With the below since I've added the stock control message change, the reload doesn’t work. I’ve added a no conflict script but I don't think I've added it correctly. I'd like to put all 5 scripts together (above and below) in one tag that works - can anyone help out? <script language="JavaScript"> // function ImageLoadFailed() { window.event.srcElement.style.display = "None"; } // reload after adding product function AddProductExtras(){ document.location.reload(true); } // for stock control - change message function AddProductExtras(catalogId,productId,ret) { var td = document.getElementById('catProdTd_'+productId); if (td.innerHTML == 'This product is unavailable or out of stock.') td.innerHTML = 'Product added successfully.'; } jQuery.noConflict(); </script>
javascript
jquery
noconflict
null
null
null
open
script conflict === I have 5 scripts on my page and I’d like to add them altogther but am not too sure how. The first is <script type="text/javascript"><!--//--><![CDATA[//><!-- sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); //--><!]]> </script> With the below since I've added the stock control message change, the reload doesn’t work. I’ve added a no conflict script but I don't think I've added it correctly. I'd like to put all 5 scripts together (above and below) in one tag that works - can anyone help out? <script language="JavaScript"> // function ImageLoadFailed() { window.event.srcElement.style.display = "None"; } // reload after adding product function AddProductExtras(){ document.location.reload(true); } // for stock control - change message function AddProductExtras(catalogId,productId,ret) { var td = document.getElementById('catProdTd_'+productId); if (td.innerHTML == 'This product is unavailable or out of stock.') td.innerHTML = 'Product added successfully.'; } jQuery.noConflict(); </script>
0
11,425,239
07/11/2012 03:47:59
1,505,916
07/06/2012 06:24:18
1
0
Ajax response xml is null Java script
Servlet response: for(int i=0;i<projNames.size();i++) { sb.append("<project>"); sb.append("<projectName>" + projNames.get(i) + "</projectName>"); sb.append("</project>"); res.setContentType("text/xml"); res.setHeader("Cache-Control", "no-cache"); System.out.println(" test="+test); res.getWriter().write(sb.toString()); System.o.p shows "sb" value as <project><projectName>sample</projectName></project><project><projectName>sample 2</projectName></project> I'm trying to retrieve the response XML and but when i checked the length "object value is null" ( debugged in IE 8 ) function displayValues() { var response; if(req.responseXML!=null) alert("res xml is ther=="+ response); //displays UNDEFINED else alert("no res xml"); response = req.responseXML.getElementsByTagName("project")[0]; alert("child node"+response.childNodes.length); // alert is not displayed } Please enlighten. Thanks
javascript
ajax
xmlhttprequest
null
null
null
open
Ajax response xml is null Java script === Servlet response: for(int i=0;i<projNames.size();i++) { sb.append("<project>"); sb.append("<projectName>" + projNames.get(i) + "</projectName>"); sb.append("</project>"); res.setContentType("text/xml"); res.setHeader("Cache-Control", "no-cache"); System.out.println(" test="+test); res.getWriter().write(sb.toString()); System.o.p shows "sb" value as <project><projectName>sample</projectName></project><project><projectName>sample 2</projectName></project> I'm trying to retrieve the response XML and but when i checked the length "object value is null" ( debugged in IE 8 ) function displayValues() { var response; if(req.responseXML!=null) alert("res xml is ther=="+ response); //displays UNDEFINED else alert("no res xml"); response = req.responseXML.getElementsByTagName("project")[0]; alert("child node"+response.childNodes.length); // alert is not displayed } Please enlighten. Thanks
0
11,542,760
07/18/2012 13:39:22
1,455,354
06/14/2012 05:20:22
333
18
How to set yesterday date in DatePicker using Jquery
Im having a textbox,when user click on it calender appears.This works fine,the calender showing the current date and previous date all are disable.But now i want to show calender with yesterday date selected.How can i achieve this.Thanks in advance.
php
jquery
datepicker
null
null
null
open
How to set yesterday date in DatePicker using Jquery === Im having a textbox,when user click on it calender appears.This works fine,the calender showing the current date and previous date all are disable.But now i want to show calender with yesterday date selected.How can i achieve this.Thanks in advance.
0
11,542,761
07/18/2012 13:39:24
1,291,862
03/25/2012 22:00:39
72
6
CanCan, nested resources and using methods
In my new project, I have a resource Bet which other users can only read if they are the owners of the bet or friends of him. The main problem comes when I want to define abilities for the index action. In an index action, the block does not get executed, so I guess it's not an option. Let's illustrate it. If I wanted only the owner to be able to index the bets, this would be enough: can :read, Bet, :user => { :id => user.id } But I need the acceptable ids to be a range, one defined by all the friends of the user. Something like: if (bet.user == user) || (bet.user.friends.include? user) can :read, Bet end But this is not correct CanCan syntax. I guess that a lot of people has had problems with CanCan and nested resources, but I still haven't seen any answer to this.
ruby-on-rails
ruby
ruby-on-rails-3
cancan
null
null
open
CanCan, nested resources and using methods === In my new project, I have a resource Bet which other users can only read if they are the owners of the bet or friends of him. The main problem comes when I want to define abilities for the index action. In an index action, the block does not get executed, so I guess it's not an option. Let's illustrate it. If I wanted only the owner to be able to index the bets, this would be enough: can :read, Bet, :user => { :id => user.id } But I need the acceptable ids to be a range, one defined by all the friends of the user. Something like: if (bet.user == user) || (bet.user.friends.include? user) can :read, Bet end But this is not correct CanCan syntax. I guess that a lot of people has had problems with CanCan and nested resources, but I still haven't seen any answer to this.
0
11,542,394
07/18/2012 13:19:51
976,982
10/03/2011 15:43:49
15
2
Trouble with DolphinNav Container - cannot invoke onclick, ASP.NET
I'm having trouble calling a method using onclick from a dolhpin nav container. I need to call a method that clears session variables whenever an item in the navigation bar at the top of my site is clicked. The method can be invoked from other places no problem (I did this just to test), but nothing happens when I call it from the nav. I've tried calling it from the container div, the nav div, the repeater, the list item, the href tag and the span. None worked. Nav code here: <div id="dolphincontainer"> <div id="dolphinnav" runat="server"> <asp:Repeater ID="rptTopNav" runat="server"> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate> <li runat="server" id="liTest"><a rel="tooltip" title="<%# DataBinder.Eval(Container.DataItem, "title") %>" href="<%# DataBinder.Eval(Container.DataItem, "Url") %>" class='<%# DataBinder.Eval(Container.DataItem, "class") %>' onclick="clearSession"><span><%# DataBinder.Eval(Container.DataItem, "NavTitle") %></span></a></li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater> </div> </div> The nav also has a hover item in it using JQuery, although this problem predates the addition of that code. I've tried stepping through the code and the method never gets invoked. Any ideas? Thanks in advance for the help.
c#
asp.net
html
null
null
null
open
Trouble with DolphinNav Container - cannot invoke onclick, ASP.NET === I'm having trouble calling a method using onclick from a dolhpin nav container. I need to call a method that clears session variables whenever an item in the navigation bar at the top of my site is clicked. The method can be invoked from other places no problem (I did this just to test), but nothing happens when I call it from the nav. I've tried calling it from the container div, the nav div, the repeater, the list item, the href tag and the span. None worked. Nav code here: <div id="dolphincontainer"> <div id="dolphinnav" runat="server"> <asp:Repeater ID="rptTopNav" runat="server"> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate> <li runat="server" id="liTest"><a rel="tooltip" title="<%# DataBinder.Eval(Container.DataItem, "title") %>" href="<%# DataBinder.Eval(Container.DataItem, "Url") %>" class='<%# DataBinder.Eval(Container.DataItem, "class") %>' onclick="clearSession"><span><%# DataBinder.Eval(Container.DataItem, "NavTitle") %></span></a></li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater> </div> </div> The nav also has a hover item in it using JQuery, although this problem predates the addition of that code. I've tried stepping through the code and the method never gets invoked. Any ideas? Thanks in advance for the help.
0
11,542,395
07/18/2012 13:19:59
185,824
10/07/2009 18:07:14
2,290
95
How to select Dictionary value with most appearances
Dictionary<objectx,objecty> d. I want to select objecty with the most appearances in "d" using LINQ. d.GroupBy(t => t.Value) gave me result i cannot get values from. Thanks
c#
linq
null
null
null
null
open
How to select Dictionary value with most appearances === Dictionary<objectx,objecty> d. I want to select objecty with the most appearances in "d" using LINQ. d.GroupBy(t => t.Value) gave me result i cannot get values from. Thanks
0
11,542,762
07/18/2012 13:39:24
953,770
09/20/2011 00:57:53
151
15
How to combine gems from multiple Gemfiles to run one Ruby program?
**My Question** Suppose I have a directory structure like this: app/ core/ bin/ runner Gemfile ... Gemfile lib/ The "core" is an application which has its own Gemfile and Gemfile.lock. I don't want to modify core in any way. app/Gemfile is part of my plugin to core, which also has a Gemfile (listing its own dependencies that are additional to core/Gemfile). I can "bundle install" from the app/core/ and app/ directories. How can I run core/bin/runner from the app/ directory in such a way that it will include all the Ruby gems from both app/core/Gemfile and app/Gemfile? **Background** I am writing a plugin for Logstash, using C Ruby. Logstash includes its own Gemfile; once all dependencies are fetched, the total package size is about 40MB. I want to run Logstash in Heroku. To avoid putting 40MB of stuff into Git, I have forked the Ruby buildpack (https://github.com/inscitiv/heroku-buildpack-logstash) and modified it to download Logstash, unpack it, and use its Gemfile. This works fine, but I am stuck with the Gemfile provided by Logstash. For my plugins, I want to add new dependencies that my plugins will use; I don't really want to fork Logstash and change its Gemfile in order to accomplish this. Instead, I want to unpack Logstash into its own directory (logstash/), and then I want to overlay my plugin code, including Gemfile for dependencies, on top of it. Then I want to run a Heroku "worker" process which will run logstash, specifying "." as the plugins directory, and has access to all the gems from both Gemfiles.
ruby
heroku
rubygems
bundler
logstash
null
open
How to combine gems from multiple Gemfiles to run one Ruby program? === **My Question** Suppose I have a directory structure like this: app/ core/ bin/ runner Gemfile ... Gemfile lib/ The "core" is an application which has its own Gemfile and Gemfile.lock. I don't want to modify core in any way. app/Gemfile is part of my plugin to core, which also has a Gemfile (listing its own dependencies that are additional to core/Gemfile). I can "bundle install" from the app/core/ and app/ directories. How can I run core/bin/runner from the app/ directory in such a way that it will include all the Ruby gems from both app/core/Gemfile and app/Gemfile? **Background** I am writing a plugin for Logstash, using C Ruby. Logstash includes its own Gemfile; once all dependencies are fetched, the total package size is about 40MB. I want to run Logstash in Heroku. To avoid putting 40MB of stuff into Git, I have forked the Ruby buildpack (https://github.com/inscitiv/heroku-buildpack-logstash) and modified it to download Logstash, unpack it, and use its Gemfile. This works fine, but I am stuck with the Gemfile provided by Logstash. For my plugins, I want to add new dependencies that my plugins will use; I don't really want to fork Logstash and change its Gemfile in order to accomplish this. Instead, I want to unpack Logstash into its own directory (logstash/), and then I want to overlay my plugin code, including Gemfile for dependencies, on top of it. Then I want to run a Heroku "worker" process which will run logstash, specifying "." as the plugins directory, and has access to all the gems from both Gemfiles.
0
11,542,770
07/18/2012 13:39:58
698,582
04/08/2011 11:53:33
126
39
Signing identity not found on XCODE (Organizer)
I already made iPhone application thanks to all certificates and so on. Now, I'm installing a second mac to develop applicaions (the same applications) so : - I generated a Certification Signin Request (with keychain) - I didn't upload it but I downloaded the Distribution Certificate (that I generated before with the old computer), and install it (in keychain again) - I Downloaded the Distribution Provisioning profile The last File , I installed it and in Organizer, the status of the file is "Valid Signing identity not found". How can I fix that problem ? This is common operations but I always have trouble with all those certificates :-) Thanks
iphone
xcode
iphone-provisioning
provisioning-profile
organizer
null
open
Signing identity not found on XCODE (Organizer) === I already made iPhone application thanks to all certificates and so on. Now, I'm installing a second mac to develop applicaions (the same applications) so : - I generated a Certification Signin Request (with keychain) - I didn't upload it but I downloaded the Distribution Certificate (that I generated before with the old computer), and install it (in keychain again) - I Downloaded the Distribution Provisioning profile The last File , I installed it and in Organizer, the status of the file is "Valid Signing identity not found". How can I fix that problem ? This is common operations but I always have trouble with all those certificates :-) Thanks
0
11,542,771
07/18/2012 13:39:59
6,244
09/13/2008 07:26:29
4,789
500
Is it possible to use a slickgrid inside an editor for another slickgrid?
I would like to write a custom editor for a column in my slickgrid. Ideally this editor would include another slickgrid that allows the user to filter and select multiple items. - Has anyone tried writing an editor that includes another instance of a slickgrid? - Are there any gotcha's I should avoid?
javascript
jquery
slickgrid
slickgrid-editors
null
null
open
Is it possible to use a slickgrid inside an editor for another slickgrid? === I would like to write a custom editor for a column in my slickgrid. Ideally this editor would include another slickgrid that allows the user to filter and select multiple items. - Has anyone tried writing an editor that includes another instance of a slickgrid? - Are there any gotcha's I should avoid?
0
11,542,772
07/18/2012 13:40:02
1,534,915
07/18/2012 13:25:01
1
0
text out of line when viewing site from mobile
I recently whipped this site up for one of my first clients. At present i cant seem to find the reason that the text under each heading is slightly to the left when browsing from a mobile device. (using galaxy nexus) http://www.digitalgenesis.com.au/2012-websites/qsoils/example3.html<br><br> Everything else on the page displays perfectly and ive been trying to identify the problem with no success I would like the text under the maroon headings to display in its full width which is 60% of the total wrapping container, the text should also be centered reletive to the maroon line like it does on a normal screen size as each .info tag has been given a margin:0 auto; property Any help would be appreciated even though its not a fatal error for the design, Cheers
html
css
mobile
text-alignment
fluid-dynamics
null
open
text out of line when viewing site from mobile === I recently whipped this site up for one of my first clients. At present i cant seem to find the reason that the text under each heading is slightly to the left when browsing from a mobile device. (using galaxy nexus) http://www.digitalgenesis.com.au/2012-websites/qsoils/example3.html<br><br> Everything else on the page displays perfectly and ive been trying to identify the problem with no success I would like the text under the maroon headings to display in its full width which is 60% of the total wrapping container, the text should also be centered reletive to the maroon line like it does on a normal screen size as each .info tag has been given a margin:0 auto; property Any help would be appreciated even though its not a fatal error for the design, Cheers
0
11,542,763
07/18/2012 13:39:35
1,534,941
07/18/2012 13:33:40
1
0
Flexigrid filtering
I am working on a "advanced" filtering option for a list using Flexigrid. We have filters already done by checkboxes. but when I click a button for advanced search after putting in my fields and searching the list will refresh as normally losing all searched criteria. Does anyone know of a solution within flexigrid that would allow me to override the refresh?
java
javascript
jquery
jquery-ui
null
null
open
Flexigrid filtering === I am working on a "advanced" filtering option for a list using Flexigrid. We have filters already done by checkboxes. but when I click a button for advanced search after putting in my fields and searching the list will refresh as normally losing all searched criteria. Does anyone know of a solution within flexigrid that would allow me to override the refresh?
0
11,542,774
07/18/2012 13:40:17
777,695
05/31/2011 12:51:12
88
0
mdb & libumem & findleaks
In my app i can see a leakage, threfore i ran it with libumem, a then i typed `::findleaks`. The result was: -bash-4.0# mdb -o nostop -p 441 mdb: failed to initialize //lib/64/libc_db.so.1: libthread_db call failed unexpectedly mdb: warning: debugger will only be able to examine raw LWPs Loading modules: [ ld.so.1 libumem.so.1 libc.so.1 libuutil.so.1 libnvpair.so.1 libavl.so.1 ] > ::findleaks BYTES LEAKED VMEM_SEG CALLER 4096 2 fffffd7ffdd68000 MMAP 8192 1 fffffd7ffee4e000 MMAP ------------------------------------------------------------------------ Total 2 oversized leaks, 12288 bytes CACHE LEAKED BUFFER CALLER fffffd7fff094028 1 fffffd7fb504afb8 ? ------------------------------------------------------------------------ Total 1 buffer, 8 bytes > fffffd7fb504afb8::dis 0xfffffd7fb504afb8: orb %al,(%rax) 0xfffffd7fb504afba: addb %al,(%rax) 0xfffffd7fb504afbc: clc 0xfffffd7fb504afbd: movl $0x83a10,%edi 0xfffffd7fb504afc2: addb %al,(%rax) 0xfffffd7fb504afc4: clc 0xfffffd7fb504afc5: movl $0x40283a10,%edi 0xfffffd7fb504afca: orl %edi,%edi 0xfffffd7fb504afcc: jg -0x3 <0xfffffd7fb504afcb> 0xfffffd7fb504afce: ***ERROR--unknown op code*** 0xfffffd7fb504afd0: addb %ah,0xfffffffffd7fb504(%rax) > fffffd7fb504afb8::bufctl_audit ADDR BUFADDR TIMESTAMP THREAD CACHE LASTLOG CONTENTS fffffd7fb504afb8 3a10bff800000008 fffffd7fff094188 -16170616 fffffd7fb504a000 fffffd7fb504afb0 2 0 0 0 0xfffffd7fb504b008 0 0xfffffd7fb504b018 0 0xfffffd7fb504b028 0 0xfffffd7fb504b038 0 0xfffffd7fb504b048 0 0xfffffd7fb504b058 0 I'd like to ask, why i cannot see 'CALLER' field. Application was compiled with -g flag, so debugging symbols should not be stripped. enviroment symbols were: <envvar name='umem_path' value='libumem.so.1'/> <envvar name='UMEM_OPTIONS' value='backend=mmap'/> <envvar name='UMEM_DEBUG' value='default'/> <envvar name='UMEM_LOGGING' value='transaction=1G'/> <envvar name='umem_path' value='libumem.so.1'/> The OS is: -bash-4.0# cat /etc/release OpenIndiana Development oi_148 X86 Copyright 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Assembled 29 November 2010 -bash-4.0# uname -a SunOS app.srv 5.11 oi_148 i86pc i386 i86pc Solaris Best regards J
solaris
libumem
null
null
null
null
open
mdb & libumem & findleaks === In my app i can see a leakage, threfore i ran it with libumem, a then i typed `::findleaks`. The result was: -bash-4.0# mdb -o nostop -p 441 mdb: failed to initialize //lib/64/libc_db.so.1: libthread_db call failed unexpectedly mdb: warning: debugger will only be able to examine raw LWPs Loading modules: [ ld.so.1 libumem.so.1 libc.so.1 libuutil.so.1 libnvpair.so.1 libavl.so.1 ] > ::findleaks BYTES LEAKED VMEM_SEG CALLER 4096 2 fffffd7ffdd68000 MMAP 8192 1 fffffd7ffee4e000 MMAP ------------------------------------------------------------------------ Total 2 oversized leaks, 12288 bytes CACHE LEAKED BUFFER CALLER fffffd7fff094028 1 fffffd7fb504afb8 ? ------------------------------------------------------------------------ Total 1 buffer, 8 bytes > fffffd7fb504afb8::dis 0xfffffd7fb504afb8: orb %al,(%rax) 0xfffffd7fb504afba: addb %al,(%rax) 0xfffffd7fb504afbc: clc 0xfffffd7fb504afbd: movl $0x83a10,%edi 0xfffffd7fb504afc2: addb %al,(%rax) 0xfffffd7fb504afc4: clc 0xfffffd7fb504afc5: movl $0x40283a10,%edi 0xfffffd7fb504afca: orl %edi,%edi 0xfffffd7fb504afcc: jg -0x3 <0xfffffd7fb504afcb> 0xfffffd7fb504afce: ***ERROR--unknown op code*** 0xfffffd7fb504afd0: addb %ah,0xfffffffffd7fb504(%rax) > fffffd7fb504afb8::bufctl_audit ADDR BUFADDR TIMESTAMP THREAD CACHE LASTLOG CONTENTS fffffd7fb504afb8 3a10bff800000008 fffffd7fff094188 -16170616 fffffd7fb504a000 fffffd7fb504afb0 2 0 0 0 0xfffffd7fb504b008 0 0xfffffd7fb504b018 0 0xfffffd7fb504b028 0 0xfffffd7fb504b038 0 0xfffffd7fb504b048 0 0xfffffd7fb504b058 0 I'd like to ask, why i cannot see 'CALLER' field. Application was compiled with -g flag, so debugging symbols should not be stripped. enviroment symbols were: <envvar name='umem_path' value='libumem.so.1'/> <envvar name='UMEM_OPTIONS' value='backend=mmap'/> <envvar name='UMEM_DEBUG' value='default'/> <envvar name='UMEM_LOGGING' value='transaction=1G'/> <envvar name='umem_path' value='libumem.so.1'/> The OS is: -bash-4.0# cat /etc/release OpenIndiana Development oi_148 X86 Copyright 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Assembled 29 November 2010 -bash-4.0# uname -a SunOS app.srv 5.11 oi_148 i86pc i386 i86pc Solaris Best regards J
0
11,542,775
07/18/2012 13:40:18
463,192
09/30/2010 19:11:36
1,048
34
Server.MapPath not refreshing after changing the directory of an ASP.NET application
I have 2 ASP.NET applications. Let's say App1 and App2. From App1, when I call Server.MapPath("/App2") I get the physical path of the App2 application. When I change the path of App2 in IIS and I call Server.MapPath("/App2") again from App1, I get the same result. I have to restart App1 for it to notice then change. Is there something I can do about this without restarting App1?
asp.net
.net
iis
null
null
null
open
Server.MapPath not refreshing after changing the directory of an ASP.NET application === I have 2 ASP.NET applications. Let's say App1 and App2. From App1, when I call Server.MapPath("/App2") I get the physical path of the App2 application. When I change the path of App2 in IIS and I call Server.MapPath("/App2") again from App1, I get the same result. I have to restart App1 for it to notice then change. Is there something I can do about this without restarting App1?
0
11,351,406
07/05/2012 19:40:33
714,969
04/19/2011 10:05:10
4,133
293
Data Modeling Two Foreign Keys Referencing the Same Primary Key
If I had two foreign keys in a table referencing the same primary key in another table, what type of relationship is this? One to many? or One to One? For example: Table Author has primary key AUTHOR_ID Table Book has two foreign keys PRIMARY_AUTHOR_ID and SECONDARY_AUTHOR_ID both reference AUTHOR_ID What type of relationship is this? *I know the author book example could be handled in a better way, I am just using those fields for an example.
database
data
modeling
null
null
null
open
Data Modeling Two Foreign Keys Referencing the Same Primary Key === If I had two foreign keys in a table referencing the same primary key in another table, what type of relationship is this? One to many? or One to One? For example: Table Author has primary key AUTHOR_ID Table Book has two foreign keys PRIMARY_AUTHOR_ID and SECONDARY_AUTHOR_ID both reference AUTHOR_ID What type of relationship is this? *I know the author book example could be handled in a better way, I am just using those fields for an example.
0
11,351,408
07/05/2012 19:40:35
1,064,659
11/24/2011 21:11:36
4,511
161
Why doesn't require add all names?
I have a file, `my_helper.rb`, that looks like this: require 'cgi' require 'enumerator' module MyHelper # ... end class MyUpstreamError < StandardError # ... end When I `require 'my_helper'` elsewhere, `MyHelper` becomes visible, but `MyUpstreamError` does not. Why is this?
ruby
null
null
null
null
null
open
Why doesn't require add all names? === I have a file, `my_helper.rb`, that looks like this: require 'cgi' require 'enumerator' module MyHelper # ... end class MyUpstreamError < StandardError # ... end When I `require 'my_helper'` elsewhere, `MyHelper` becomes visible, but `MyUpstreamError` does not. Why is this?
0
11,351,349
07/05/2012 19:36:05
890,416
08/11/2011 17:25:47
166
5
Two Facts - Two different grains
I'm just getting back into SSAS after inheriting an existing cube and I'm not sure how to proceed with this scenario: Budget Fact: - Product - Customer - Time Promo Fact: - Product - Customer - Promotion - Time I'm looking to do a report combining measures from the Budget Measure Group and Promo Measure Group. Essentially I'm trying to get a list of Customers and Products where the Promotion.Discount Value > .4. This means I have to pull the Promotion Dimension into my dataset and that's where things start getting hairy. A report on Customer, Product, Promo ID, and Promo.Amount is 1565 records. A report on Customer, Product and Budget.Amount is 31 records. A report on Customer, Product, Promo ID, Promo.Amount and Budget.Amount is 179,878 records! Really what I'm trying to achieve (from a SQL point of view) is to return a list of Customers and Products where the Promo Discount Value is > .4 then link that to another dataset on Customer ID and Product ID to get the budget value. I've spent a fair bit of time reading about the Dimension Usage facility etc and nothing seems to be helping. Any advice?!
ssas
null
null
null
null
null
open
Two Facts - Two different grains === I'm just getting back into SSAS after inheriting an existing cube and I'm not sure how to proceed with this scenario: Budget Fact: - Product - Customer - Time Promo Fact: - Product - Customer - Promotion - Time I'm looking to do a report combining measures from the Budget Measure Group and Promo Measure Group. Essentially I'm trying to get a list of Customers and Products where the Promotion.Discount Value > .4. This means I have to pull the Promotion Dimension into my dataset and that's where things start getting hairy. A report on Customer, Product, Promo ID, and Promo.Amount is 1565 records. A report on Customer, Product and Budget.Amount is 31 records. A report on Customer, Product, Promo ID, Promo.Amount and Budget.Amount is 179,878 records! Really what I'm trying to achieve (from a SQL point of view) is to return a list of Customers and Products where the Promo Discount Value is > .4 then link that to another dataset on Customer ID and Product ID to get the budget value. I've spent a fair bit of time reading about the Dimension Usage facility etc and nothing seems to be helping. Any advice?!
0
11,351,415
07/05/2012 19:41:14
277,826
02/20/2010 21:01:00
1,751
89
Open-source 'applet' interactive 2D vector animation engines?
I am interested in producing short interactive 2D vector animations; an example would be: <sub> an application with a textfield accepting a number N, and a button - upon clicking the button, N squares of different colors are generated, and animated for 10 seconds; once animation stops, process can be repeated. </sub> I would call something like this "applet", as opposed to a "game" - although, obviously, a 2D game engine would be perfectly capable of implementing similar application. Additionally, I would like to avoid programming in C++/C/Java, and instead use something more like a scripting language; I would imagine a lot of these applets would be simple enough, so one application could be contained in a single source code file. Finally, I would like relatively simple cross-platform delivery. Currently, I am aware of Flash - and JavaScript for HTML5 Canvas - for applicability like this. ### Flash ### _ActionScript 2_ * Language: ActionScript 2 * Compiler: [mtasc](http://www.mtasc.org/) * Delivery: Player software: [Gnash](http://www.gnu.org/software/gnash/) (standalone or browser plugin, Linux) _ActionScript 3_ (_[single file "applet" example](http://stackoverflow.com/questions/10243353/yet-another-local-file-access-in-actionscript-3-q-u-e-stion)_) * Language: ActionScript 3 * Compiler: [mxmlc](http://livedocs.adobe.com/flex/3/html/compilers_14.html), part of Flex SDK ([here](http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3sdk) or [here](http://www.adobe.com/devnet/flex/flex-sdk-download.html)) * Delivery: Player software: [Lightspark](http://lightspark.github.com/) (standalone or browser plugin, Linux) ### HTML5 Canvas ### * Language: JavaScript + library APIs * Compiler: none * Delivery: HTML5 Canvas-enabled web browser (`firefox`, ...) Animation functionality in this case, as of now, seems dependent on external libraries, many of which are described in [HTML5 Canvas Vector Graphics?](http://stackoverflow.com/questions/4340040/html5-canvas-vector-graphics); see also: * [10 Super JavaScript Animation Frameworks | jQuery4u](http://www.jquery4u.com/animation/10-super-javascript-animation-frameworks/) (Jan 2012) * [17 Javascript Animation Frameworks Worth Checking Out | Admix Web](http://www.admixweb.com/2010/01/07/17-javascript-animation-frameworks-worth-to-seing/) (Jan 2010) * [16 Impressive Flash-Like Javascript Animation Inspirations, Tutorials and Plugins | Queness](http://www.queness.com/post/456/16-impressive-flash-like-javascript-animation-inspirations-tutorials-and-plugins) (Jul 2009) * [10 Impressive JavaScript Animation Frameworks](http://sixrevisions.com/javascript/10-impressive-javascript-animation-frameworks/) (Jun 2009) (<sub>"<code>N __ JavaScript Animation __</code>" is now a meme, apparently `:)`</sub>) Typical JavaScript libraries mentioned in this context are: * Processing.js * Raphaël * Cake * The Burst Engine ------ Basically, I find **ActionScript** as language very suitable for the task - I can draw vectors in code using `lineTo`; treat them as `MovieClip` objects; specify framerate and run code `onEnterFrame`, as well as have access to keyboard and mouse interaction events, and ability to run timed code (`setTimeout`, `setInterval`). I also don't have a problem with the compilation step that generates the `swf`; besides some error checking, I think it is also responsible for the decent performance of Flash vector movies. I work on Linux, and for myself, I could relatively easily set up one of the above development environments. Problem is the delivery - if I want an open-source delivery, then I don't have cross-platform compatibility anymore (as the known open-source players seem to be Linux only). In comparison, **JavaScript**/HTML5 Canvas would be great - since for delivery, I'd count on reproduction in established open-source web browsers. However: * first problem is performance - most examples I've seen cause my `firefox` 13 in Ubuntu to go nearly 100% CPU on both processors, while doing relatively average animations (<sub>and I can imagine the browser choking, should I want to animate some N=250 circles in my example stated above</sub>). * second problem is dependency on external libraries, so the concept of single source-file application becomes more complicated (<sub>Also, vendors may disappear - not sure if it's temporary, but currently I cannot access the site [hyper-metrix.com](http://hyper-metrix.com/#Burst) often given as home of the Burst JS library</sub>) * finally - while JavaScript and ActionScript (as I understand) should follow same/similar ECMAScript specifications - some of the JavaScript libraries are not really intended for treatment of vector drawings as objects: some, instead, try to simplify access to effects like "tweening" and gradual color changes through a simple, one-liner language construct, which something I actually do _not_ need in this case (<sub>thus, finding a suitable Javascript syntax (for this particular applet use I intend) could also be a problem</sub>) ----- So, given my notes above, what other alternatives do I have? I'm pretty sure `python` would have something - does `perl` have something too, or any other languages? Also, what would the requirements for delivery be (besides installing a given language interpreter for a given operating system), and what could one expect performance-wise (e.g. can random linear motion of 250 circles in a 640x480 px window at 45 fps, be reasonably expected on an Atom class netbook)? Many thanks in advance for any answers, Cheers!
animation
open-source
cross-platform
2d
engine
null
open
Open-source 'applet' interactive 2D vector animation engines? === I am interested in producing short interactive 2D vector animations; an example would be: <sub> an application with a textfield accepting a number N, and a button - upon clicking the button, N squares of different colors are generated, and animated for 10 seconds; once animation stops, process can be repeated. </sub> I would call something like this "applet", as opposed to a "game" - although, obviously, a 2D game engine would be perfectly capable of implementing similar application. Additionally, I would like to avoid programming in C++/C/Java, and instead use something more like a scripting language; I would imagine a lot of these applets would be simple enough, so one application could be contained in a single source code file. Finally, I would like relatively simple cross-platform delivery. Currently, I am aware of Flash - and JavaScript for HTML5 Canvas - for applicability like this. ### Flash ### _ActionScript 2_ * Language: ActionScript 2 * Compiler: [mtasc](http://www.mtasc.org/) * Delivery: Player software: [Gnash](http://www.gnu.org/software/gnash/) (standalone or browser plugin, Linux) _ActionScript 3_ (_[single file "applet" example](http://stackoverflow.com/questions/10243353/yet-another-local-file-access-in-actionscript-3-q-u-e-stion)_) * Language: ActionScript 3 * Compiler: [mxmlc](http://livedocs.adobe.com/flex/3/html/compilers_14.html), part of Flex SDK ([here](http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3sdk) or [here](http://www.adobe.com/devnet/flex/flex-sdk-download.html)) * Delivery: Player software: [Lightspark](http://lightspark.github.com/) (standalone or browser plugin, Linux) ### HTML5 Canvas ### * Language: JavaScript + library APIs * Compiler: none * Delivery: HTML5 Canvas-enabled web browser (`firefox`, ...) Animation functionality in this case, as of now, seems dependent on external libraries, many of which are described in [HTML5 Canvas Vector Graphics?](http://stackoverflow.com/questions/4340040/html5-canvas-vector-graphics); see also: * [10 Super JavaScript Animation Frameworks | jQuery4u](http://www.jquery4u.com/animation/10-super-javascript-animation-frameworks/) (Jan 2012) * [17 Javascript Animation Frameworks Worth Checking Out | Admix Web](http://www.admixweb.com/2010/01/07/17-javascript-animation-frameworks-worth-to-seing/) (Jan 2010) * [16 Impressive Flash-Like Javascript Animation Inspirations, Tutorials and Plugins | Queness](http://www.queness.com/post/456/16-impressive-flash-like-javascript-animation-inspirations-tutorials-and-plugins) (Jul 2009) * [10 Impressive JavaScript Animation Frameworks](http://sixrevisions.com/javascript/10-impressive-javascript-animation-frameworks/) (Jun 2009) (<sub>"<code>N __ JavaScript Animation __</code>" is now a meme, apparently `:)`</sub>) Typical JavaScript libraries mentioned in this context are: * Processing.js * Raphaël * Cake * The Burst Engine ------ Basically, I find **ActionScript** as language very suitable for the task - I can draw vectors in code using `lineTo`; treat them as `MovieClip` objects; specify framerate and run code `onEnterFrame`, as well as have access to keyboard and mouse interaction events, and ability to run timed code (`setTimeout`, `setInterval`). I also don't have a problem with the compilation step that generates the `swf`; besides some error checking, I think it is also responsible for the decent performance of Flash vector movies. I work on Linux, and for myself, I could relatively easily set up one of the above development environments. Problem is the delivery - if I want an open-source delivery, then I don't have cross-platform compatibility anymore (as the known open-source players seem to be Linux only). In comparison, **JavaScript**/HTML5 Canvas would be great - since for delivery, I'd count on reproduction in established open-source web browsers. However: * first problem is performance - most examples I've seen cause my `firefox` 13 in Ubuntu to go nearly 100% CPU on both processors, while doing relatively average animations (<sub>and I can imagine the browser choking, should I want to animate some N=250 circles in my example stated above</sub>). * second problem is dependency on external libraries, so the concept of single source-file application becomes more complicated (<sub>Also, vendors may disappear - not sure if it's temporary, but currently I cannot access the site [hyper-metrix.com](http://hyper-metrix.com/#Burst) often given as home of the Burst JS library</sub>) * finally - while JavaScript and ActionScript (as I understand) should follow same/similar ECMAScript specifications - some of the JavaScript libraries are not really intended for treatment of vector drawings as objects: some, instead, try to simplify access to effects like "tweening" and gradual color changes through a simple, one-liner language construct, which something I actually do _not_ need in this case (<sub>thus, finding a suitable Javascript syntax (for this particular applet use I intend) could also be a problem</sub>) ----- So, given my notes above, what other alternatives do I have? I'm pretty sure `python` would have something - does `perl` have something too, or any other languages? Also, what would the requirements for delivery be (besides installing a given language interpreter for a given operating system), and what could one expect performance-wise (e.g. can random linear motion of 250 circles in a 640x480 px window at 45 fps, be reasonably expected on an Atom class netbook)? Many thanks in advance for any answers, Cheers!
0
11,351,410
07/05/2012 19:40:54
804,440
06/18/2011 11:00:15
8
0
Building html from an ajax call to jquey UIs sortable list
Im having a design problem in HTML/JavaScript. I appended jquery UIs sortable to my web-application: Heres a demo on sortable (cant show my application now): http://jqueryui.com/demos/sortable/default.html Now im populating that drag and drop list in JavaScript with data from an ajax call. The list is changed by users all the time. I try do something like this: Var htmlData = '<div id=wrapper>' +'<div>' +data.title +'</div>' +'<div>' +data.description +'</div>'; ${"#sortable-list"}.html(htmlData); And so on. Some of the divs also have attributes set in variables like `'id="' + data.id + '"'` I then try to fit this string htmldata in the sortable-list. But it's getting messy pretty quick. I tried to fit `<tables>` in it, and `<p>` with `<span>`s in. But it's still hard to get the design that I want. Cant post images due to lack of reputation but here's the design i want: http://img546.imageshack.us/img546/9179/48361880.gif So how would you do this? I've been reading about templates like mustache but it don't seems to help me. And the way I building the table with a string can't be the best way. Any example or info on how to do this is much appreciated
javascript
jquery
jquery-ui
html-lists
null
null
open
Building html from an ajax call to jquey UIs sortable list === Im having a design problem in HTML/JavaScript. I appended jquery UIs sortable to my web-application: Heres a demo on sortable (cant show my application now): http://jqueryui.com/demos/sortable/default.html Now im populating that drag and drop list in JavaScript with data from an ajax call. The list is changed by users all the time. I try do something like this: Var htmlData = '<div id=wrapper>' +'<div>' +data.title +'</div>' +'<div>' +data.description +'</div>'; ${"#sortable-list"}.html(htmlData); And so on. Some of the divs also have attributes set in variables like `'id="' + data.id + '"'` I then try to fit this string htmldata in the sortable-list. But it's getting messy pretty quick. I tried to fit `<tables>` in it, and `<p>` with `<span>`s in. But it's still hard to get the design that I want. Cant post images due to lack of reputation but here's the design i want: http://img546.imageshack.us/img546/9179/48361880.gif So how would you do this? I've been reading about templates like mustache but it don't seems to help me. And the way I building the table with a string can't be the best way. Any example or info on how to do this is much appreciated
0
11,351,411
07/05/2012 19:40:59
860,528
07/24/2011 19:17:20
140
0
jQuery - setInterval issue
I am using jQuery to generate and add a random amount of Clouds to the Header of the page and move them left on the specified interval. Everything is working fine, execpt the interval only runs once for each Cloud and not again. Here is my code: if(enableClouds) { var cloudCount = Math.floor(Math.random() * 11); // Random Number between 1 & 10 for(cnt = 0; cnt < cloudCount; cnt++) { var cloudNumber = Math.floor(Math.random() * 4); var headerHeight = $('header').height() / 2; var cloudLeft = Math.floor(Math.random() * docWidth); var cloudTop = 0; var thisHeight = 0; var cloudType = "one"; if(cloudNumber == 2) { cloudType = "two"; }else if(cloudNumber == 3) { cloudType = "three"; } $('header').append('<div id="cloud' + cnt + '" class="cloud ' + cloudType + '"></div>'); thisHeight = $('#cloud' + cnt).height(); headerHeight -= thisHeight; cloudTop = Math.floor(Math.random() * headerHeight); $('#cloud' + cnt).css({ 'left' : cloudLeft, 'top' : cloudTop }); setInterval(moveCloud(cnt), 100); } function moveCloud(cloud) { var thisLeft = $('#cloud' + cloud).css('left'); alert(thisLeft); } } Any help is appreciated!
javascript
jquery
null
null
null
null
open
jQuery - setInterval issue === I am using jQuery to generate and add a random amount of Clouds to the Header of the page and move them left on the specified interval. Everything is working fine, execpt the interval only runs once for each Cloud and not again. Here is my code: if(enableClouds) { var cloudCount = Math.floor(Math.random() * 11); // Random Number between 1 & 10 for(cnt = 0; cnt < cloudCount; cnt++) { var cloudNumber = Math.floor(Math.random() * 4); var headerHeight = $('header').height() / 2; var cloudLeft = Math.floor(Math.random() * docWidth); var cloudTop = 0; var thisHeight = 0; var cloudType = "one"; if(cloudNumber == 2) { cloudType = "two"; }else if(cloudNumber == 3) { cloudType = "three"; } $('header').append('<div id="cloud' + cnt + '" class="cloud ' + cloudType + '"></div>'); thisHeight = $('#cloud' + cnt).height(); headerHeight -= thisHeight; cloudTop = Math.floor(Math.random() * headerHeight); $('#cloud' + cnt).css({ 'left' : cloudLeft, 'top' : cloudTop }); setInterval(moveCloud(cnt), 100); } function moveCloud(cloud) { var thisLeft = $('#cloud' + cloud).css('left'); alert(thisLeft); } } Any help is appreciated!
0
2,777,269
05/05/2010 22:42:00
206,552
11/09/2009 02:47:02
1
0
How can I use SVN to manage my Firefox Extension project?
I'm using SVN to manage my Firefox extension project, and this project contains an XPCOM component. Firefox is loading directly from my working directory by placing a text file with the working directory's path in the ./extensions directory of my user profile. When Firefox starts, my extension fails to load & overlay; examining the Error Console, I see that the error states that ".svn cannot be loaded as a component" - a reference to the .svn directory inside my "components" directory of the plug-in structure. Is there any way to get Firefox to ignore this directory, or get SVN to generate a working copy without the .svn directories in it?
svn
firefox
firefox-addon
version-control
null
null
open
How can I use SVN to manage my Firefox Extension project? === I'm using SVN to manage my Firefox extension project, and this project contains an XPCOM component. Firefox is loading directly from my working directory by placing a text file with the working directory's path in the ./extensions directory of my user profile. When Firefox starts, my extension fails to load & overlay; examining the Error Console, I see that the error states that ".svn cannot be loaded as a component" - a reference to the .svn directory inside my "components" directory of the plug-in structure. Is there any way to get Firefox to ignore this directory, or get SVN to generate a working copy without the .svn directories in it?
0
11,411,354
07/10/2012 10:27:11
1,429,749
06/01/2012 02:28:30
6
0
Mysql 2 Tables join Limit Result return from both Table
I have been trying this requirement for few hours but im clueless as im not getting the desired result. I have two table. **Main Comment Table ---------------------------------------------------------------------------- id | comments | date_commented | comment_owner | commented_by 1 hello world ********** 321 123 Child Comment Table ---------------------------------------------------------------------------- id | mainpostID| child_comment_data | commented_by | date_commented** 1 1 child comment of hello world 456 ******** My requirement: <br/> I want to retrieve the first 10 Main Comment along with Chilcomments for each Main comment. I will like to limit the number of Child comments to 5 for each Main comment. What i tried: SELECT maincomment.comments, childcomment.child_comment_data FROM maincomment LEFT JOIN childcomment ON maincomment.id = childcomment.mainpostID AND maincomment.comment_owner = childcomment.commented_by WHERE maincomment.id = childcomment.mainpostID ORDER BY dateposted DESC LIMIT 10 Results: Im getting only 10 Maincomments but the number of childcomments are just 1 for each Main comment. What i need is to return 5 childcomments for each of the Maincomment. Will anyone please help out with some suggestions / query here. Thanks alot.
sql
join
null
null
null
null
open
Mysql 2 Tables join Limit Result return from both Table === I have been trying this requirement for few hours but im clueless as im not getting the desired result. I have two table. **Main Comment Table ---------------------------------------------------------------------------- id | comments | date_commented | comment_owner | commented_by 1 hello world ********** 321 123 Child Comment Table ---------------------------------------------------------------------------- id | mainpostID| child_comment_data | commented_by | date_commented** 1 1 child comment of hello world 456 ******** My requirement: <br/> I want to retrieve the first 10 Main Comment along with Chilcomments for each Main comment. I will like to limit the number of Child comments to 5 for each Main comment. What i tried: SELECT maincomment.comments, childcomment.child_comment_data FROM maincomment LEFT JOIN childcomment ON maincomment.id = childcomment.mainpostID AND maincomment.comment_owner = childcomment.commented_by WHERE maincomment.id = childcomment.mainpostID ORDER BY dateposted DESC LIMIT 10 Results: Im getting only 10 Maincomments but the number of childcomments are just 1 for each Main comment. What i need is to return 5 childcomments for each of the Maincomment. Will anyone please help out with some suggestions / query here. Thanks alot.
0
11,411,356
07/10/2012 10:27:15
748,881
05/11/2011 14:24:42
1
0
Filter inbound request http
I have some website on IIS6 on Windows 2003. I want to allow for one website only http connection from some IP addresses. Is it possible to do so by acting on the configuration of IIS? Thanks Oronzo
iis6
filtering
null
null
null
null
open
Filter inbound request http === I have some website on IIS6 on Windows 2003. I want to allow for one website only http connection from some IP addresses. Is it possible to do so by acting on the configuration of IIS? Thanks Oronzo
0
11,411,454
07/10/2012 10:33:06
709,626
04/15/2011 10:14:47
1,239
36
php disk_total_space() minus disk_free_space() does not equal occupied space
I wanted to check space available on the storage, where I'm storing users' attachments. I went with [`disk_free_space()`][1] and [`disk_total_space()`][2]. The result is: >Free space: 5.47 GB >Total space: 5.86 GB So the space occupied = **0.39 GB**. I also looped through the files to catch their size with [`filesize()`][3]. In total the files occupy **18.34 GB**. (The maximum file size is 4 MB, so the note in the PHP manual regarding 2GB does note apply) So: >Total space - Free space **!=** Occupied space Why? The filesystem is on HP-UX. I measured all all the values using the same account - I ran all the command from a php script, by executing the script with an internet browser. I also checked the functions in Windows. The results were OK. I went through some other questions related to the functions ( http://stackoverflow.com/questions/2425841/how-to-get-the-disk-space-on-a-server, http://stackoverflow.com/questions/2806866/how-to-determin-how-much-space-is-freeon-your-server-php, http://stackoverflow.com/questions/7199513/how-to-detect-the-server-space-enough-for-the-uploaded-file-or-no, http://stackoverflow.com/questions/2425841/how-to-get-the-disk-space-on-a-server, http://stackoverflow.com/questions/4713893/is-it-possible-to-get-special-local-disk-information-from-php, http://stackoverflow.com/questions/466140/php-disk-total-space), but did not find an answer. [1]: http://php.net/disk_free_space/ [2]: http://php.net/disk_total_space/ [3]: http://php.net/filesize/
php
filesystems
size
hpux
null
null
open
php disk_total_space() minus disk_free_space() does not equal occupied space === I wanted to check space available on the storage, where I'm storing users' attachments. I went with [`disk_free_space()`][1] and [`disk_total_space()`][2]. The result is: >Free space: 5.47 GB >Total space: 5.86 GB So the space occupied = **0.39 GB**. I also looped through the files to catch their size with [`filesize()`][3]. In total the files occupy **18.34 GB**. (The maximum file size is 4 MB, so the note in the PHP manual regarding 2GB does note apply) So: >Total space - Free space **!=** Occupied space Why? The filesystem is on HP-UX. I measured all all the values using the same account - I ran all the command from a php script, by executing the script with an internet browser. I also checked the functions in Windows. The results were OK. I went through some other questions related to the functions ( http://stackoverflow.com/questions/2425841/how-to-get-the-disk-space-on-a-server, http://stackoverflow.com/questions/2806866/how-to-determin-how-much-space-is-freeon-your-server-php, http://stackoverflow.com/questions/7199513/how-to-detect-the-server-space-enough-for-the-uploaded-file-or-no, http://stackoverflow.com/questions/2425841/how-to-get-the-disk-space-on-a-server, http://stackoverflow.com/questions/4713893/is-it-possible-to-get-special-local-disk-information-from-php, http://stackoverflow.com/questions/466140/php-disk-total-space), but did not find an answer. [1]: http://php.net/disk_free_space/ [2]: http://php.net/disk_total_space/ [3]: http://php.net/filesize/
0
11,408,673
07/10/2012 07:39:11
1,513,882
07/10/2012 06:37:16
1
0
NSSet intersectsSet implementation
I need to to make a method to compare some NSSet and see if there are all the objects there or if there is missing one object and what object is. I just made on the viewDidLoad method, but I need a method who will check all the NSSet (there are a lot). What I did not work so well. - (void)viewDidLoad { [super viewDidLoad]; NSMutableSet *masterSet = [[NSMutableSet alloc] initWithObjects:@"0", @"1", @"2", @"3", @"4" ,nil]; NSMutableSet *set2 = [[NSMutableSet alloc] initWithObjects:@"0", @"1", @"2", @"3", nil]; NSMutableSet *set3 = [[NSMutableSet alloc] initWithObjects:@"2", @"10", @"12", @"14", @"18", nil]; if ([masterSet intersectsSet:set2] == [set2 count]) { NSLog(@"set2: %@", set2); } In this example I try to check, If all the object on set2 are in masterSet, so I print set2. I don't understand why this is not work well, because this is not print on the log. If some one can help me, I need to make this "If" on a method that will check all the NSset I have, and to check if there is missing one object to full match, get this object too. Thank you all
iphone
objective-c
ios5
xcode4.3
null
null
open
NSSet intersectsSet implementation === I need to to make a method to compare some NSSet and see if there are all the objects there or if there is missing one object and what object is. I just made on the viewDidLoad method, but I need a method who will check all the NSSet (there are a lot). What I did not work so well. - (void)viewDidLoad { [super viewDidLoad]; NSMutableSet *masterSet = [[NSMutableSet alloc] initWithObjects:@"0", @"1", @"2", @"3", @"4" ,nil]; NSMutableSet *set2 = [[NSMutableSet alloc] initWithObjects:@"0", @"1", @"2", @"3", nil]; NSMutableSet *set3 = [[NSMutableSet alloc] initWithObjects:@"2", @"10", @"12", @"14", @"18", nil]; if ([masterSet intersectsSet:set2] == [set2 count]) { NSLog(@"set2: %@", set2); } In this example I try to check, If all the object on set2 are in masterSet, so I print set2. I don't understand why this is not work well, because this is not print on the log. If some one can help me, I need to make this "If" on a method that will check all the NSset I have, and to check if there is missing one object to full match, get this object too. Thank you all
0
11,408,674
07/10/2012 07:39:12
1,514,003
07/10/2012 07:26:44
1
0
How to get PayPal's user data using paypal_permissions gem?
<p>I need to get Transaction data(date, valued).Can I use this gem with some modifications as in this [question](http://stackoverflow.com/questions/11389726/how-to-receive-payment-data-or-user-data-from-paypal-using-paypal-permissions-ge)?<p> <p>Also, from documentation: For example, if you plan to query PayPal using getBasicPersonalData and getAdvancedPersonalData, you might generate a merchant model like: rails generate paypal_permissions merchant email:string first_name:string last_name:string full_name:string country:string payer_id:string street1:string street2:string city:string state:string postal_code_string phone:string birth_date:string bundle exec rake db:migrate. It is place,where I will write data, but how I can get data from PayPal ? <p>Can anyone give me example of code ?
ruby-on-rails
transactions
report
paypal-api
null
null
open
How to get PayPal's user data using paypal_permissions gem? === <p>I need to get Transaction data(date, valued).Can I use this gem with some modifications as in this [question](http://stackoverflow.com/questions/11389726/how-to-receive-payment-data-or-user-data-from-paypal-using-paypal-permissions-ge)?<p> <p>Also, from documentation: For example, if you plan to query PayPal using getBasicPersonalData and getAdvancedPersonalData, you might generate a merchant model like: rails generate paypal_permissions merchant email:string first_name:string last_name:string full_name:string country:string payer_id:string street1:string street2:string city:string state:string postal_code_string phone:string birth_date:string bundle exec rake db:migrate. It is place,where I will write data, but how I can get data from PayPal ? <p>Can anyone give me example of code ?
0
11,411,156
07/10/2012 10:16:05
1,514,058
07/10/2012 07:49:32
1
0
Symfony2 + Doctrine2 - PersistentCollection of CTI entities disapears in the second acces
I have a /** * @ORM\OneToMany(targetEntity="Smarti", mappedBy="station") */ private $smartis; Smarti is an abstract entity that has child CTI entities, smartiA, smartiB, smartiC... When I call the getSmartis() method, first time, all is correct (i have a PersistentCollection), but second time, is not a Collection, is only one of childs smartis. (ex. one instance of SmartiA). Where is the problem?
inheritance
symfony-2.0
doctrine2
null
null
null
open
Symfony2 + Doctrine2 - PersistentCollection of CTI entities disapears in the second acces === I have a /** * @ORM\OneToMany(targetEntity="Smarti", mappedBy="station") */ private $smartis; Smarti is an abstract entity that has child CTI entities, smartiA, smartiB, smartiC... When I call the getSmartis() method, first time, all is correct (i have a PersistentCollection), but second time, is not a Collection, is only one of childs smartis. (ex. one instance of SmartiA). Where is the problem?
0
11,411,466
07/10/2012 10:33:57
903,679
08/20/2011 11:20:07
11
1
HTTP Server in java
I am developing high performance HTTP Server in java using Socket Programming.I have developed the Server .But now I have to test the server such that if it can process 512 Transactions per second or not.Plz suggest me any way to perform this.
java
sockets
httpserver
null
null
07/10/2012 12:19:30
not constructive
HTTP Server in java === I am developing high performance HTTP Server in java using Socket Programming.I have developed the Server .But now I have to test the server such that if it can process 512 Transactions per second or not.Plz suggest me any way to perform this.
4
11,411,467
07/10/2012 10:33:59
713,629
04/18/2011 14:58:42
15
0
JSF2, RichFaces 4, rich:select, Return null if nothing changed
I use JSF2, RichFaces 4, rich:select. Manually input is allowed and user can input something which doesn't correspond to any predefined item labels. How to set value = null in this case (if any of items is not chosen)? <rich:select id="select" valueChangeListener="#{comboBoxBean.valueChangedGo}" enableManualInput="true" required="false"> <f:selectItem itemValue="0" itemLabel="Russia" /> <f:selectItem itemValue="1" itemLabel="Ukraine" /> <f:selectItem itemValue="2" itemLabel="Norway" /> <f:selectItem itemValue="3" itemLabel="Sweden" /> <f:selectItem itemValue="4" itemLabel="Finland" /> <f:selectItem itemValue="4" itemLabel="Belarus" /> <f:ajax render="count2"/> </rich:select>
validation
jsf-2.0
combobox
richfaces
null
null
open
JSF2, RichFaces 4, rich:select, Return null if nothing changed === I use JSF2, RichFaces 4, rich:select. Manually input is allowed and user can input something which doesn't correspond to any predefined item labels. How to set value = null in this case (if any of items is not chosen)? <rich:select id="select" valueChangeListener="#{comboBoxBean.valueChangedGo}" enableManualInput="true" required="false"> <f:selectItem itemValue="0" itemLabel="Russia" /> <f:selectItem itemValue="1" itemLabel="Ukraine" /> <f:selectItem itemValue="2" itemLabel="Norway" /> <f:selectItem itemValue="3" itemLabel="Sweden" /> <f:selectItem itemValue="4" itemLabel="Finland" /> <f:selectItem itemValue="4" itemLabel="Belarus" /> <f:ajax render="count2"/> </rich:select>
0
11,411,469
07/10/2012 10:34:06
1,180,092
01/31/2012 10:39:16
144
0
Rails 3.1 - Split Column on Data import?
I'm importing sales data from iTunes successfully using: FasterCSV.parse(uploaded_io, {:headers => true, :col_sep =>"\t"}).each do |row_data| new_record = AppleSale.new( 'provider' => row_data[0], 'provider_country' => row_data[1], 'vendor_identifier' => row_data[2], 'upc' => row_data[3], 'isrc' => row_data[4], 'artist_show' => row_data[5], 'title' => row_data[6], 'label_studio_network' => row_data[7], 'product_type_identifier' => row_data[8], 'units' => row_data[9], 'royalty_price' => row_data[10], 'download_date' => row_data[11], 'order_id' => row_data[12], 'postal_code' => row_data[13], 'customer_identifier' => row_data[14], 'report_date' => row_data[15], 'sale_return' => row_data[16], 'customer_currency' => row_data[17], 'country_code' => row_data[18], 'royalty_currency' => row_data[19], 'preorder' => row_data[20], 'isan' => row_data[21], 'customer_price' => row_data[22], 'apple_identifier' => row_data[23], 'cma' => row_data[24], 'asset_content_flavor' => row_data[25], 'vendor_order_code' => row_data[26], 'grid' => row_data[27], 'promo_code' => row_data[28], 'parent_identifier' => row_data[29] ) new_record.save end 'vendor_order_code' however contains values like '0711297494143_CADE70900648' that i'd like to split on the underscore and store in two separate (new) columns. Not all entries have a value like this, some just contain the first part (a UPC). I realise there are already UPC and ISRC columns provided but these aren't populated in a way that's useful to me, splitting the vendor_order_code is the only way I can do what I need to do. Can anyone suggest the correct way of doing this? I know the below is complete nonsense, but i'm thinking something along the lines of: 'vendor_order_code' => row_data[26], 'vendor_order_code_UPC' => row_data[26].split("_")...and save just the first half regardless of whether split occurred. 'vendor_order_code_ISRC' => row_data[26].split("_")..and save just the second half if it exists
ruby-on-rails
ruby
ruby-on-rails-3
null
null
null
open
Rails 3.1 - Split Column on Data import? === I'm importing sales data from iTunes successfully using: FasterCSV.parse(uploaded_io, {:headers => true, :col_sep =>"\t"}).each do |row_data| new_record = AppleSale.new( 'provider' => row_data[0], 'provider_country' => row_data[1], 'vendor_identifier' => row_data[2], 'upc' => row_data[3], 'isrc' => row_data[4], 'artist_show' => row_data[5], 'title' => row_data[6], 'label_studio_network' => row_data[7], 'product_type_identifier' => row_data[8], 'units' => row_data[9], 'royalty_price' => row_data[10], 'download_date' => row_data[11], 'order_id' => row_data[12], 'postal_code' => row_data[13], 'customer_identifier' => row_data[14], 'report_date' => row_data[15], 'sale_return' => row_data[16], 'customer_currency' => row_data[17], 'country_code' => row_data[18], 'royalty_currency' => row_data[19], 'preorder' => row_data[20], 'isan' => row_data[21], 'customer_price' => row_data[22], 'apple_identifier' => row_data[23], 'cma' => row_data[24], 'asset_content_flavor' => row_data[25], 'vendor_order_code' => row_data[26], 'grid' => row_data[27], 'promo_code' => row_data[28], 'parent_identifier' => row_data[29] ) new_record.save end 'vendor_order_code' however contains values like '0711297494143_CADE70900648' that i'd like to split on the underscore and store in two separate (new) columns. Not all entries have a value like this, some just contain the first part (a UPC). I realise there are already UPC and ISRC columns provided but these aren't populated in a way that's useful to me, splitting the vendor_order_code is the only way I can do what I need to do. Can anyone suggest the correct way of doing this? I know the below is complete nonsense, but i'm thinking something along the lines of: 'vendor_order_code' => row_data[26], 'vendor_order_code_UPC' => row_data[26].split("_")...and save just the first half regardless of whether split occurred. 'vendor_order_code_ISRC' => row_data[26].split("_")..and save just the second half if it exists
0
11,410,725
07/10/2012 09:52:33
1,415,967
05/24/2012 19:59:26
16
0
Dynamically populating checkbox from database using ajax
I am new with JQuery. (I want to do it using AJAX, JQuery, PHP) I am trying to dynamically populate a list of checkboxes from the database. What I have is a drop down. Based on the selected option I want to query the database, and depending on the recordset I want to dynamically display the checkboxes. Any suggestions
jquery
jquery-ui
jquery-ajax
checkbox
null
null
open
Dynamically populating checkbox from database using ajax === I am new with JQuery. (I want to do it using AJAX, JQuery, PHP) I am trying to dynamically populate a list of checkboxes from the database. What I have is a drop down. Based on the selected option I want to query the database, and depending on the recordset I want to dynamically display the checkboxes. Any suggestions
0
11,410,726
07/10/2012 09:52:34
475,247
10/14/2010 01:45:32
541
3
Android ApiDemos sample application errors
I have created Android ApiDemos sample application in my Eclipse IDE, but it complains numerous errors (69 errors and 100 warnings). I have properly included the recommended depended jar `android-support-v4.jar`. I have tried various build targets, from Eclair to Jelly Bean. What am I missing?
android
eclipse
adt
null
null
null
open
Android ApiDemos sample application errors === I have created Android ApiDemos sample application in my Eclipse IDE, but it complains numerous errors (69 errors and 100 warnings). I have properly included the recommended depended jar `android-support-v4.jar`. I have tried various build targets, from Eclair to Jelly Bean. What am I missing?
0
11,693,434
07/27/2012 18:18:20
385,913
07/07/2010 19:43:41
2,896
115
What is the invalid URI error from SpamAssassin actually matching?
I'm trying to debug some emails that are getting sent to the Spam Folder by SpamAssassin and I encountered an error that I'm having trouble fixing. The problem seems to be that there's an invalid URI somewhere in the email, but I'm not sure how to find it. Maybe if I could figure out what the error is matching, it would help. This is the actual error I'm getting back: 0.6 SARE_OBFU_AMP invalid character within URI host/domain Did some digging on Google and it looks like this is the REGEX that the rule is based on *([Source][1])* m{(?!(?:mailto:|\#).*)^(?:https?://)?[^/\?]{4,40}\&}i So the actual question is: **What does the error I'm getting actually mean and how can I actually identify the bad URI?** [1]: http://mta.org.ua/spamassassin/stuff/spamass-rules/spamass-rules-20050821/70_sare_obfu1.cf
regex
spamassassin
null
null
null
null
open
What is the invalid URI error from SpamAssassin actually matching? === I'm trying to debug some emails that are getting sent to the Spam Folder by SpamAssassin and I encountered an error that I'm having trouble fixing. The problem seems to be that there's an invalid URI somewhere in the email, but I'm not sure how to find it. Maybe if I could figure out what the error is matching, it would help. This is the actual error I'm getting back: 0.6 SARE_OBFU_AMP invalid character within URI host/domain Did some digging on Google and it looks like this is the REGEX that the rule is based on *([Source][1])* m{(?!(?:mailto:|\#).*)^(?:https?://)?[^/\?]{4,40}\&}i So the actual question is: **What does the error I'm getting actually mean and how can I actually identify the bad URI?** [1]: http://mta.org.ua/spamassassin/stuff/spamass-rules/spamass-rules-20050821/70_sare_obfu1.cf
0
11,693,439
07/27/2012 18:18:33
1,558,152
07/27/2012 15:51:17
1
0
Make tables from different databases match each other
I am trying to update a table so that all values become identical to another table on a different database. I can do it with an insert command but not an update command. This works: INSERT [test1].[dbo].[table1] SELECT * FROM [source].[dbo].[table1] This does not: UPDATE [test2].[dbo].[table1] SET [source].[dbo].[table1] = [test2].[dbo].[table1] nor this: UPDATE [test2].[dbo].[table1] SET [test2].[dbo].[table1].[PKcolumn] = [source].[dbo].[table1].[PKcolumn] ,[test2].[dbo].[table1].[column2] = [source].[dbo].[table1].[column2] ,[test2].[dbo].[table1].[column3] = [source].[dbo].[table1].[column3] WHERE [source].[dbo].[table1].[PKcolumn] = [test2].[dbo].[table1].[PKcolumn] The result is always some variation of this error message despite checking for errors countless times: Msg 4104, Level 16, State 1, Line 1 The multi-part identifier "source.dbo.table1.PKColumn" could not be bound. Any Suggestions?
sql
database
sql-update
insert-update
sql-insert
null
open
Make tables from different databases match each other === I am trying to update a table so that all values become identical to another table on a different database. I can do it with an insert command but not an update command. This works: INSERT [test1].[dbo].[table1] SELECT * FROM [source].[dbo].[table1] This does not: UPDATE [test2].[dbo].[table1] SET [source].[dbo].[table1] = [test2].[dbo].[table1] nor this: UPDATE [test2].[dbo].[table1] SET [test2].[dbo].[table1].[PKcolumn] = [source].[dbo].[table1].[PKcolumn] ,[test2].[dbo].[table1].[column2] = [source].[dbo].[table1].[column2] ,[test2].[dbo].[table1].[column3] = [source].[dbo].[table1].[column3] WHERE [source].[dbo].[table1].[PKcolumn] = [test2].[dbo].[table1].[PKcolumn] The result is always some variation of this error message despite checking for errors countless times: Msg 4104, Level 16, State 1, Line 1 The multi-part identifier "source.dbo.table1.PKColumn" could not be bound. Any Suggestions?
0
11,693,440
07/27/2012 18:18:34
1,538,100
07/19/2012 13:48:26
291
32
How can I prevent my anchors jumping my screen around so much
I decided to try and create a tabbed menu using just css and html. Using :target to show the appropriate div, only now I've implemented it, it jumps around a bit too much to be user friendly. http://brad.sebdengroup.com/newodynsite/stockman.php#StockControl Is there anyway I can fix this? Initially I wanted to stay away from javascript but will happily add some in if it fixes this. Note: I know I can rebuild a new tabbed menu using jQuery/some fancy library but if possible, I'd rather fix this
javascript
html
css
anchor
fragment-identifier
null
open
How can I prevent my anchors jumping my screen around so much === I decided to try and create a tabbed menu using just css and html. Using :target to show the appropriate div, only now I've implemented it, it jumps around a bit too much to be user friendly. http://brad.sebdengroup.com/newodynsite/stockman.php#StockControl Is there anyway I can fix this? Initially I wanted to stay away from javascript but will happily add some in if it fixes this. Note: I know I can rebuild a new tabbed menu using jQuery/some fancy library but if possible, I'd rather fix this
0
11,693,445
07/27/2012 18:18:51
325,558
04/25/2010 20:58:20
298
4
Recycle old fashioned Web net3.5 using Razor type Engines possible?
I have a complete web application using standard webforms in net3.5. I lovelly goint to other renders methods like Razor to use templated views without change my application, but adding some extensions if possible. I haved tested the Razor engine but it use always net4.0. Other ways exist?. Can you suggest us some alternatives and compilation methods to work around net3.5 without goint in a MVC solution. Thanks. Best Regards.
c#
asp.net
razor
.net-3.5
null
null
open
Recycle old fashioned Web net3.5 using Razor type Engines possible? === I have a complete web application using standard webforms in net3.5. I lovelly goint to other renders methods like Razor to use templated views without change my application, but adding some extensions if possible. I haved tested the Razor engine but it use always net4.0. Other ways exist?. Can you suggest us some alternatives and compilation methods to work around net3.5 without goint in a MVC solution. Thanks. Best Regards.
0
11,693,446
07/27/2012 18:18:59
1,555,935
07/26/2012 20:15:21
1
0
Batch file to copy files based on part of filename from one server to another
I'm trying to create a batch file (via Windows XP Pro) that copies 2 files (.zpl) who's filename's vary in length. ZPL files relate to label printer code. File names are as follows: FillXferDataPBHAMFill###########.zpl FillFormatsPBHAMFill############.zpl The pound signs represent a number associated with a particular label/job to be printed. These numbers are identical per job. From one job to the next the numbers vary in length and always change. The directory I'm trying to pull these from contains ZPL files from multiple locations, however, I just want the BHAM ones. The batch will copy from: \\Server\C:\Directory1\Directory2\Directory3 To be copied to: \\Server\Directory1\Directory2 Not sure if this will complicate things further, but the batch file will be ran from a 3rd machine. Furthermore, I do not need to copy every file everytime. Whenever new print jobs are sent, supervisors will run the batch to copy the new print jobs within the last X amount of time. X being minutes. Here is what I have so far... @echo off SETLOCAL enableExtensions enableDelayedExpansion SET sourceDir=Server\C:\Directory1\Directory2\Directory3 SET targetDir=Server\Directory1\Directory2 FOR %%a (FillFormatsPBHAM*.bat) DO ( SET "filename=%%a" SET "folder=%targetDir%" XCOPY "%%a" !folder! ) FOR %%a (FillXferDataPBHAM*.bat) DO ( SET "filename=%%a" SET "folder=%targetDir%" XCOPY "%%a" !folder! ) :END I apologize for a lengthy post; just wanting to be as thorough as possible. I'm learning this on the fly so bare with any ignorance on my part. Thank you in advance for ANY help!! StackOverFlow Material Reviewed: [Reference1][1], [Reference2][2] -- I've been looking everywhere over the past week and these were the 2 most helpful so far. [1]: http://stackoverflow.com/questions/11500242/batch-file-to-copy-files-based-on-characters-in-filename [2]: http://stackoverflow.com/questions/6357046/batch-file-to-copy-files-from-one-server-to-other-adding-remote-directory-to-fil
batch
batch-file
null
null
null
null
open
Batch file to copy files based on part of filename from one server to another === I'm trying to create a batch file (via Windows XP Pro) that copies 2 files (.zpl) who's filename's vary in length. ZPL files relate to label printer code. File names are as follows: FillXferDataPBHAMFill###########.zpl FillFormatsPBHAMFill############.zpl The pound signs represent a number associated with a particular label/job to be printed. These numbers are identical per job. From one job to the next the numbers vary in length and always change. The directory I'm trying to pull these from contains ZPL files from multiple locations, however, I just want the BHAM ones. The batch will copy from: \\Server\C:\Directory1\Directory2\Directory3 To be copied to: \\Server\Directory1\Directory2 Not sure if this will complicate things further, but the batch file will be ran from a 3rd machine. Furthermore, I do not need to copy every file everytime. Whenever new print jobs are sent, supervisors will run the batch to copy the new print jobs within the last X amount of time. X being minutes. Here is what I have so far... @echo off SETLOCAL enableExtensions enableDelayedExpansion SET sourceDir=Server\C:\Directory1\Directory2\Directory3 SET targetDir=Server\Directory1\Directory2 FOR %%a (FillFormatsPBHAM*.bat) DO ( SET "filename=%%a" SET "folder=%targetDir%" XCOPY "%%a" !folder! ) FOR %%a (FillXferDataPBHAM*.bat) DO ( SET "filename=%%a" SET "folder=%targetDir%" XCOPY "%%a" !folder! ) :END I apologize for a lengthy post; just wanting to be as thorough as possible. I'm learning this on the fly so bare with any ignorance on my part. Thank you in advance for ANY help!! StackOverFlow Material Reviewed: [Reference1][1], [Reference2][2] -- I've been looking everywhere over the past week and these were the 2 most helpful so far. [1]: http://stackoverflow.com/questions/11500242/batch-file-to-copy-files-based-on-characters-in-filename [2]: http://stackoverflow.com/questions/6357046/batch-file-to-copy-files-from-one-server-to-other-adding-remote-directory-to-fil
0
11,693,455
07/27/2012 18:19:35
463,061
09/30/2010 16:40:51
37
1
ASP.NET MVC model binding - different names for JSON property and C# model properties
I've annotated the properties of my model classes as below. [DataMember(Name = "EN")] public string EmployeeName{ get; set; } This overall results in a compact JSON (I'm serializing using JSON.NET serializer). However when JSON containing these smaller names is passed using a POST or a PUT request to the controllers, ASP.NET MVC model binding is not able to correctly map the "EN" JSON property to "EmployeeName". It expects "EmployeeName" in JSON. Any thoughts on how to fix this?
c#
asp.net
mvc
model
null
null
open
ASP.NET MVC model binding - different names for JSON property and C# model properties === I've annotated the properties of my model classes as below. [DataMember(Name = "EN")] public string EmployeeName{ get; set; } This overall results in a compact JSON (I'm serializing using JSON.NET serializer). However when JSON containing these smaller names is passed using a POST or a PUT request to the controllers, ASP.NET MVC model binding is not able to correctly map the "EN" JSON property to "EmployeeName". It expects "EmployeeName" in JSON. Any thoughts on how to fix this?
0
11,693,402
07/27/2012 18:15:21
1,079,898
12/04/2011 08:58:26
27
0
Alternative for looping in R
df1 <- data.frame(Chr=1, Pos= c(100,200,300,400),stringsAsFactors=F) df2 <- data.frame(Chr=1, PosStart= c(25,25,150,175,225,275,375),PosEnd= c(150,75,275,300,400,500,750),stringsAsFactors=F) I am trying to compare the Pos values in df1 to see if the fall between any PosStart and PosEnd of df2. This could be true for more than 1 rows of df2. In the output I am trying to append the df1$Pos as a new column df2$CoPos; each time the condition is true. The output should be someting like: Chr PosStart PosEnd CoPos 1 25 150 100 1 150 275 200 1 175 300 200 1 225 400 300 1 275 500 300 1 375 750 400 I have done something like: for(i in 1:length(df1$Pos)){ for(j in 1:length(df2$PosStart){ df2$CoPos[j]<- df1$Pos[which(df2$PosStart[j] < df1$Pos[i] < df2$PosEnd[j])] } } Can someone please tell me if there is a way to do this without looping. Also what am I doing wrong here? After months of grappling I don't think I still understand the concept of looping. Thanks a bunch in advance.
r
null
null
null
null
null
open
Alternative for looping in R === df1 <- data.frame(Chr=1, Pos= c(100,200,300,400),stringsAsFactors=F) df2 <- data.frame(Chr=1, PosStart= c(25,25,150,175,225,275,375),PosEnd= c(150,75,275,300,400,500,750),stringsAsFactors=F) I am trying to compare the Pos values in df1 to see if the fall between any PosStart and PosEnd of df2. This could be true for more than 1 rows of df2. In the output I am trying to append the df1$Pos as a new column df2$CoPos; each time the condition is true. The output should be someting like: Chr PosStart PosEnd CoPos 1 25 150 100 1 150 275 200 1 175 300 200 1 225 400 300 1 275 500 300 1 375 750 400 I have done something like: for(i in 1:length(df1$Pos)){ for(j in 1:length(df2$PosStart){ df2$CoPos[j]<- df1$Pos[which(df2$PosStart[j] < df1$Pos[i] < df2$PosEnd[j])] } } Can someone please tell me if there is a way to do this without looping. Also what am I doing wrong here? After months of grappling I don't think I still understand the concept of looping. Thanks a bunch in advance.
0
11,693,456
07/27/2012 18:19:40
1,555,875
07/26/2012 19:43:21
1
0
MergeSort on an Array of more than 10000 keys
Hi i am trying to generate 10000 randoms numbers into an array and print them . but i am getting this error any help this is the code and the error import static java.lang.System.out; import java.util.Random; import java.util.Arrays; /** Generate 10 random integers in the range 0..99. */ public final class RandomInteger { public static final void main(String... aArgs){ log("Generating 1000 random integers in range 1..10500."); //note a single Random object is reused here int count=0; int[] arr = new int [10000]; Random randomGenerator = new Random(); for (int idx = 1; idx <= 10000; ++idx){ arr [idx]= randomGenerator.nextInt(100000); count++; } System.out.println(Arrays.toString(arr)); log("Done. " + count); } private static void log(String aMessage){ System.out.println(aMessage); } } Generating 1000 random integers in range 1..10500. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10000 at RandomInteger.main(RandomInteger.java:15)
java
random
numbers
null
null
null
open
MergeSort on an Array of more than 10000 keys === Hi i am trying to generate 10000 randoms numbers into an array and print them . but i am getting this error any help this is the code and the error import static java.lang.System.out; import java.util.Random; import java.util.Arrays; /** Generate 10 random integers in the range 0..99. */ public final class RandomInteger { public static final void main(String... aArgs){ log("Generating 1000 random integers in range 1..10500."); //note a single Random object is reused here int count=0; int[] arr = new int [10000]; Random randomGenerator = new Random(); for (int idx = 1; idx <= 10000; ++idx){ arr [idx]= randomGenerator.nextInt(100000); count++; } System.out.println(Arrays.toString(arr)); log("Done. " + count); } private static void log(String aMessage){ System.out.println(aMessage); } } Generating 1000 random integers in range 1..10500. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10000 at RandomInteger.main(RandomInteger.java:15)
0
11,568,114
07/19/2012 19:42:05
1,164,754
01/23/2012 10:44:05
5
2
TCPDF: SVG image not displaying correctly
I have been trying to create a PDF containing a SVG image with the TCPDF Library. I wanted to have the SVG centered on a page with some text above and below it. I have managed to get this working to a point however part of the SVG image is being cut off, it seems to have something to do with the X/Y position but I am not sure how to correct this problem. Any help would be very much appreciated and i am interested in finding out why it is doing this rather than just displaying the full SVG image as expected. <?php require_once('../../TCPDF/tcpdf.php'); // Remove the default header and footer class PDF extends TCPDF { public function Header() {} public function Footer() {} } $pdf = new PDF(); $pdf->AddPage(); $pdf->SetFont('helvetica', 'B', 160); $pdf->SetTextColor(0,0,0); $pdf->Cell(0, 0, 'Higher', 1, 1, 'C', false, '', 1); $pdf->Ln(4); $pdf->ImageSVG($file='Image.svg', $x=0, $y=80, $w=100, $h=100, $link='', $align='N', $palign='C', $border=1, $fitonpage=false); $pdf->Ln(4); $pdf->Cell(0, 0, 'Lower', 1, 1, 'C', 0, '', 1); $file = 'Result' . '.pdf'; // Set the name of the PDF file $pdf->Output($file, 'F'); // Save PDF to file $pdf->Output($file, 'I'); // Display the PDF ?>
php
image
pdf
svg
tcpdf
null
open
TCPDF: SVG image not displaying correctly === I have been trying to create a PDF containing a SVG image with the TCPDF Library. I wanted to have the SVG centered on a page with some text above and below it. I have managed to get this working to a point however part of the SVG image is being cut off, it seems to have something to do with the X/Y position but I am not sure how to correct this problem. Any help would be very much appreciated and i am interested in finding out why it is doing this rather than just displaying the full SVG image as expected. <?php require_once('../../TCPDF/tcpdf.php'); // Remove the default header and footer class PDF extends TCPDF { public function Header() {} public function Footer() {} } $pdf = new PDF(); $pdf->AddPage(); $pdf->SetFont('helvetica', 'B', 160); $pdf->SetTextColor(0,0,0); $pdf->Cell(0, 0, 'Higher', 1, 1, 'C', false, '', 1); $pdf->Ln(4); $pdf->ImageSVG($file='Image.svg', $x=0, $y=80, $w=100, $h=100, $link='', $align='N', $palign='C', $border=1, $fitonpage=false); $pdf->Ln(4); $pdf->Cell(0, 0, 'Lower', 1, 1, 'C', 0, '', 1); $file = 'Result' . '.pdf'; // Set the name of the PDF file $pdf->Output($file, 'F'); // Save PDF to file $pdf->Output($file, 'I'); // Display the PDF ?>
0
11,567,396
07/19/2012 18:50:49
70,365
02/24/2009 13:41:50
3,475
47
How to end a polling thread created with detachNewThreadSelector?
I'm creating a new thread using `detachNewThreadSelector` [ref](https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nsthread_Class/Reference/Reference.html#//apple_ref/occ/clm/NSThread/detachNewThreadSelector:toTarget:withObject:) with `toTarget` self. The purpose of the thread is to poll movements and load images as appropriate - it loops and only quits when an atomic bool is set to true in the main thread - which is set in the objects `dealloc`. The problem is caused by this (from the detachNewThreadSelector reference): > The objects aTarget and anArgument are retained during the execution of the detached thread, then released Which means my object will always have a (minimum) retain count of one - because the thread continuously polls. `dealloc` is therefore never called. So my question is: **how can I dealloc my object taking into account the existence of the polling thread?** The only idea I have right now is to create a destroyThread function of the object, which sets the end thread bool, which would be called from everywhere I'd *expect* the object to be destroyed. This seems error-prone, are there better solutions? Thanks in advance.
objective-c
ios
multithreading
nsthread
detachnewthreadselector
null
open
How to end a polling thread created with detachNewThreadSelector? === I'm creating a new thread using `detachNewThreadSelector` [ref](https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nsthread_Class/Reference/Reference.html#//apple_ref/occ/clm/NSThread/detachNewThreadSelector:toTarget:withObject:) with `toTarget` self. The purpose of the thread is to poll movements and load images as appropriate - it loops and only quits when an atomic bool is set to true in the main thread - which is set in the objects `dealloc`. The problem is caused by this (from the detachNewThreadSelector reference): > The objects aTarget and anArgument are retained during the execution of the detached thread, then released Which means my object will always have a (minimum) retain count of one - because the thread continuously polls. `dealloc` is therefore never called. So my question is: **how can I dealloc my object taking into account the existence of the polling thread?** The only idea I have right now is to create a destroyThread function of the object, which sets the end thread bool, which would be called from everywhere I'd *expect* the object to be destroyed. This seems error-prone, are there better solutions? Thanks in advance.
0
11,567,398
07/19/2012 18:51:04
1,530,369
07/17/2012 00:49:40
3
0
ebay turbolister image fixed size
can anyone tell me where in html I should lock the dimensions, so when my client put's a picture in turbolister it keep's it (rezises) as specified? I tryed to close the image in div, table ... Here is the ad: [Ebay listing][1] Please help, because my client isn't happy to change the html tags. [1]: http://www.ebay.es/itm/Prueba-/160846686157?pt=LH_DefaultDomain_186&hash=item257335a7cd#ht_2186wt_1140
templates
ebay
null
null
null
null
open
ebay turbolister image fixed size === can anyone tell me where in html I should lock the dimensions, so when my client put's a picture in turbolister it keep's it (rezises) as specified? I tryed to close the image in div, table ... Here is the ad: [Ebay listing][1] Please help, because my client isn't happy to change the html tags. [1]: http://www.ebay.es/itm/Prueba-/160846686157?pt=LH_DefaultDomain_186&hash=item257335a7cd#ht_2186wt_1140
0
11,568,100
07/19/2012 19:37:21
183,717
10/03/2009 20:08:39
1,637
3
Write different datatype values to a file in R
Is it possible to write values of different datatypes to a file in R? Currently, I am using a simple vector as follows: > vect = c (1,2, "string") > vect [1] "1" "2" "string" > write.table(vect, file="/home/sampleuser/sample.txt", append= FALSE, sep= "|") However, since `vect` is a vector of string now, opening the file has following contents being in quoted form as: "x" "1"|"1" "2"|"2" "3"|"string" Is it not possible to restore the data types of entries `1` and `2` being treated as numeric value instead of string. So my expected result is: "x" "1"|1 "2"|2 "3"|"string" also, I am assuming the left side values "1", "2" and "3" are vector indexes? I did not understand how the first line is "x"?
r
null
null
null
null
null
open
Write different datatype values to a file in R === Is it possible to write values of different datatypes to a file in R? Currently, I am using a simple vector as follows: > vect = c (1,2, "string") > vect [1] "1" "2" "string" > write.table(vect, file="/home/sampleuser/sample.txt", append= FALSE, sep= "|") However, since `vect` is a vector of string now, opening the file has following contents being in quoted form as: "x" "1"|"1" "2"|"2" "3"|"string" Is it not possible to restore the data types of entries `1` and `2` being treated as numeric value instead of string. So my expected result is: "x" "1"|1 "2"|2 "3"|"string" also, I am assuming the left side values "1", "2" and "3" are vector indexes? I did not understand how the first line is "x"?
0
11,568,123
07/19/2012 19:42:31
383,919
07/05/2010 18:37:05
168
12
Taking control of the MediaController progress slider
I need to catch touch events to the `MediaController` progress slider, so that updates to the `MediaPlayer` don't occur until the finger lifts off the slider. [ Perhaps my situation is unique: I am playing streaming video that comes in multiple "stacks" for each "program". The next stack is not loaded until the previous one is finished. The slider needs to represent the duration of all stacks, and the progress of the "thumb" needs to represent total duration. This is easily done by overriding the `getBufferPercentage()`, `getCurrentPosition()`, and `getDuration()` methods of `MediaPlayerControl` ] More problematic is "scrubbing" (moving the thumb) back and forth along the timeline. If it causes the data source to be `set` multiple times along with a `seekTo` for every movement, things very quickly bog down and crash. It would be better if the MediaPlayer did no action until the user has finished the scrub. As others have written, Yes it would be best to write my own implementation of the MediaController. But why redo all that work? I tried extending MediaController, but that got complicated quickly. I just wanted to catch the touch events to the slider!
android
video-streaming
mediaplayer
mediacontroller
null
null
open
Taking control of the MediaController progress slider === I need to catch touch events to the `MediaController` progress slider, so that updates to the `MediaPlayer` don't occur until the finger lifts off the slider. [ Perhaps my situation is unique: I am playing streaming video that comes in multiple "stacks" for each "program". The next stack is not loaded until the previous one is finished. The slider needs to represent the duration of all stacks, and the progress of the "thumb" needs to represent total duration. This is easily done by overriding the `getBufferPercentage()`, `getCurrentPosition()`, and `getDuration()` methods of `MediaPlayerControl` ] More problematic is "scrubbing" (moving the thumb) back and forth along the timeline. If it causes the data source to be `set` multiple times along with a `seekTo` for every movement, things very quickly bog down and crash. It would be better if the MediaPlayer did no action until the user has finished the scrub. As others have written, Yes it would be best to write my own implementation of the MediaController. But why redo all that work? I tried extending MediaController, but that got complicated quickly. I just wanted to catch the touch events to the slider!
0
11,568,126
07/19/2012 19:42:34
609,074
02/09/2011 01:38:37
1,937
74
Javascript: Is it possible to have variables visible "only to modules" and its extensions?
Say I have the following modules, split across multiple files both capable of *extending* `skillet`: **File1.js:** (function(){ var privateVar1 = 0; var privateFunction1 = function() { //function definiton }; skillet.fry() = function() { //fry it //matchbox.light(); }; })(window.skillet = window.skillet || {}); **File2.js:** (function(){ var privateVar2 = 0; var privateFunction2 = function() { //some private function }; skillet.grillIt = function() { //grill It //matchbox.strike(); <-- Shared with File1.js }; })(window.skillet = window.skillet || {}); Is it possible to have a shared variable/object like `matchbox` be sharable by the two modules **without** being bound to `window.matchbox` or `window.skillet.matchbox`? I.e. the *visibility* of `matchbox` should only be to File1.js and File2.js and must not be accessible elsewhere. I doubt if it's possible, but is there a way to achieve such a behavior in JavaScript? If not, what's the best practice to use in this regard? (It's more like having a shared *event-bus* among a set of related modules without exposing that bus globally)
javascript
null
null
null
null
null
open
Javascript: Is it possible to have variables visible "only to modules" and its extensions? === Say I have the following modules, split across multiple files both capable of *extending* `skillet`: **File1.js:** (function(){ var privateVar1 = 0; var privateFunction1 = function() { //function definiton }; skillet.fry() = function() { //fry it //matchbox.light(); }; })(window.skillet = window.skillet || {}); **File2.js:** (function(){ var privateVar2 = 0; var privateFunction2 = function() { //some private function }; skillet.grillIt = function() { //grill It //matchbox.strike(); <-- Shared with File1.js }; })(window.skillet = window.skillet || {}); Is it possible to have a shared variable/object like `matchbox` be sharable by the two modules **without** being bound to `window.matchbox` or `window.skillet.matchbox`? I.e. the *visibility* of `matchbox` should only be to File1.js and File2.js and must not be accessible elsewhere. I doubt if it's possible, but is there a way to achieve such a behavior in JavaScript? If not, what's the best practice to use in this regard? (It's more like having a shared *event-bus* among a set of related modules without exposing that bus globally)
0
11,568,130
07/19/2012 19:43:06
683,553
03/30/2011 08:24:48
2,183
15
PHP Echo If URL ends with text
If there anyway to show an echo in php if the url ends with some specified text? For example ... If the url ends with ?login=failed is it posible for php to echo... Echo 'Login Failed, please try again'; ... for example?
php
php5
null
null
null
null
open
PHP Echo If URL ends with text === If there anyway to show an echo in php if the url ends with some specified text? For example ... If the url ends with ?login=failed is it posible for php to echo... Echo 'Login Failed, please try again'; ... for example?
0
11,568,132
07/19/2012 19:43:08
653,837
03/10/2011 15:45:55
11
0
Facebook Connect XFBML not using correct text
I'm hoping for a little bit of help. I'm using the "Login via facebook" button to verify users ages before they enter my site using the following XFBML. <fb:login-button size="large" scope="user_birthday" onlogin='validate();'>Connect With Facebook</fb:login-button> If the user is not logged into Facebook, the text appears as expected. However if the user is already logged into Facebook and has previously visited my site through Facebook, the text says "Log In". Is there any way to make it say "Connect With Facebook" everytime? Thanks, Andrew
facebook
xfbml
null
null
null
null
open
Facebook Connect XFBML not using correct text === I'm hoping for a little bit of help. I'm using the "Login via facebook" button to verify users ages before they enter my site using the following XFBML. <fb:login-button size="large" scope="user_birthday" onlogin='validate();'>Connect With Facebook</fb:login-button> If the user is not logged into Facebook, the text appears as expected. However if the user is already logged into Facebook and has previously visited my site through Facebook, the text says "Log In". Is there any way to make it say "Connect With Facebook" everytime? Thanks, Andrew
0
11,351,428
07/05/2012 19:41:53
1,438,055
06/05/2012 18:15:44
1
0
load() a page that contains ckeditor in jquery
i have a problem with load() a page that contains ckeditor.and the problem is that when im loading my page , after load the page does not contains ckeditor anymore.my code is here: i have a problem with load() a page that contains ckeditor.and the problem is that when im loading my page , after load the page does not contains ckeditor anymore.my code is here: $("#editpost").click(function(){ $("#postbodycenter").load("editepost.php"); }); <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script> <!-- <script type="text/javascript" src="tabs.js"></script>--> <script> $(document).ready(function(){ $("#tbledit a").click(function(){ var id = $(this).attr('id'); var temp = id.charAt(0); if(temp=="d") { var data = id.substr(1, id.length); $.post("manage.php",{data:data},function(success){ alert(success); location.reload(); }); }else if(temp == "a"){ var data = id.substr(1, id.length); $.post(); } }); $('textarea.editor').ckeditor(); }); </script> </head> <body id ="body"> <center> <form method="post" name = "frmedit" id = "frmedit" action = "manage.php"> <table border = 1 id = "tbledit" width="600" align="center" style="margin: 20px; "> <tbody> <tr> <th>id</th> <th>cat</th> <th>title</th> <th>edit</th> <th>delete</th> </tr> <?php edit();?> <form id="form1" name="form1" method="post" action="editpost.php"> <table id = "tb_post"> <tbody> <tr> <td>cat:</td> <td><input type="text" name="txfcat" id="txfcat" size="130" /></td> </tr> <tr> <td>title:</td> <td><input type="text" name="title" size="130" /></td> </tr> <tr> <td>date:</td> <td><input type="text" name="date" size="130" /></td> </tr> <tr> <td>body:</td> <td><textarea class="ckeditor" cols="95" id="editor1" name="txfpost" rows="10"></textarea> </td> </tr> <tr> <td>more</td> <td><textarea class="ckeditor" cols="95" id="editor" name="txfmore" rows="10"></textarea> </td> </tr> <tr> <td></td> <td> <input type="submit" name="btnsub" id="btnsub" value="update" /></td> </tr> </tbody> </table> </form> </tbody> </table> </form> </center> </body> </html>
php
jquery
html
jquery-ajax
null
null
open
load() a page that contains ckeditor in jquery === i have a problem with load() a page that contains ckeditor.and the problem is that when im loading my page , after load the page does not contains ckeditor anymore.my code is here: i have a problem with load() a page that contains ckeditor.and the problem is that when im loading my page , after load the page does not contains ckeditor anymore.my code is here: $("#editpost").click(function(){ $("#postbodycenter").load("editepost.php"); }); <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script> <!-- <script type="text/javascript" src="tabs.js"></script>--> <script> $(document).ready(function(){ $("#tbledit a").click(function(){ var id = $(this).attr('id'); var temp = id.charAt(0); if(temp=="d") { var data = id.substr(1, id.length); $.post("manage.php",{data:data},function(success){ alert(success); location.reload(); }); }else if(temp == "a"){ var data = id.substr(1, id.length); $.post(); } }); $('textarea.editor').ckeditor(); }); </script> </head> <body id ="body"> <center> <form method="post" name = "frmedit" id = "frmedit" action = "manage.php"> <table border = 1 id = "tbledit" width="600" align="center" style="margin: 20px; "> <tbody> <tr> <th>id</th> <th>cat</th> <th>title</th> <th>edit</th> <th>delete</th> </tr> <?php edit();?> <form id="form1" name="form1" method="post" action="editpost.php"> <table id = "tb_post"> <tbody> <tr> <td>cat:</td> <td><input type="text" name="txfcat" id="txfcat" size="130" /></td> </tr> <tr> <td>title:</td> <td><input type="text" name="title" size="130" /></td> </tr> <tr> <td>date:</td> <td><input type="text" name="date" size="130" /></td> </tr> <tr> <td>body:</td> <td><textarea class="ckeditor" cols="95" id="editor1" name="txfpost" rows="10"></textarea> </td> </tr> <tr> <td>more</td> <td><textarea class="ckeditor" cols="95" id="editor" name="txfmore" rows="10"></textarea> </td> </tr> <tr> <td></td> <td> <input type="submit" name="btnsub" id="btnsub" value="update" /></td> </tr> </tbody> </table> </form> </tbody> </table> </form> </center> </body> </html>
0
11,351,201
07/05/2012 19:26:39
980,872
10/05/2011 17:24:25
62
0
Unable to bind DataGridTemplateColumn ComboBox editing template
Following is my DataGrid XAML : <DataGrid Visibility="Visible" Margin="20" ItemContainerStyle="{x:Null}" OverridesDefaultStyle="False" CellStyle="{x:Null}" Style="{x:Null}" RowStyle="{x:Null}" ColumnHeaderStyle="{x:Null}" Foreground="Black" CanUserAddRows="True" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding Path=MovieList}"> <DataGrid.Columns> <DataGridTextColumn Binding="{Binding Title, Mode=TwoWay}" CanUserResize="True" MaxWidth="450" CanUserSort="True" Header="Title" Width="200" /> <DataGridTemplateColumn Width="130" Header="Type"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Path=Type}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <ComboBox Width="120" ItemsSource="{Binding Path=GenreList}" DisplayMemberPath="Name" SelectedValuePath="ID" Height="Auto" HorizontalAlignment="Center" Name="comboBox1" VerticalAlignment="Top" /> </DataTemplate> </DataGridTemplateColumn.CellEditingTemplate> </DataGridTemplateColumn> </DataGrid.Columns> </DataGrid> The cell editing template has a ComboBox which is bound to an observable collection 'GenreList'. This collection is initialized in the ViewModel. What could be the reason for the ComboBox not getting populated ?
wpf
templates
datagrid
combobox
null
null
open
Unable to bind DataGridTemplateColumn ComboBox editing template === Following is my DataGrid XAML : <DataGrid Visibility="Visible" Margin="20" ItemContainerStyle="{x:Null}" OverridesDefaultStyle="False" CellStyle="{x:Null}" Style="{x:Null}" RowStyle="{x:Null}" ColumnHeaderStyle="{x:Null}" Foreground="Black" CanUserAddRows="True" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding Path=MovieList}"> <DataGrid.Columns> <DataGridTextColumn Binding="{Binding Title, Mode=TwoWay}" CanUserResize="True" MaxWidth="450" CanUserSort="True" Header="Title" Width="200" /> <DataGridTemplateColumn Width="130" Header="Type"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Path=Type}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <ComboBox Width="120" ItemsSource="{Binding Path=GenreList}" DisplayMemberPath="Name" SelectedValuePath="ID" Height="Auto" HorizontalAlignment="Center" Name="comboBox1" VerticalAlignment="Top" /> </DataTemplate> </DataGridTemplateColumn.CellEditingTemplate> </DataGridTemplateColumn> </DataGrid.Columns> </DataGrid> The cell editing template has a ComboBox which is bound to an observable collection 'GenreList'. This collection is initialized in the ViewModel. What could be the reason for the ComboBox not getting populated ?
0
11,351,430
07/05/2012 19:42:02
563,762
01/05/2011 10:30:29
1,358
21
Full screen apps keep switching places
I'm getting a really annoying side effect happening in osx that I can't seem to find a way to fix: for some reason the full screen applications keep switching positions. For example, if I have Safari, Mail and XCode open in full screen, in exactly that order, every once in a while they will swap positions (eg. XCode will sometimes move to the left, so the that swiping left will bring me to Safari instead of mail). The order of these applications is important for productivity purposes, and it gets really confusing when you have 6 of them open and all of a sudden Mail goes from spot 6 to spot 2. Any ideas how to get this switching of places to stop?
osx
osx-lion
null
null
null
null
open
Full screen apps keep switching places === I'm getting a really annoying side effect happening in osx that I can't seem to find a way to fix: for some reason the full screen applications keep switching positions. For example, if I have Safari, Mail and XCode open in full screen, in exactly that order, every once in a while they will swap positions (eg. XCode will sometimes move to the left, so the that swiping left will bring me to Safari instead of mail). The order of these applications is important for productivity purposes, and it gets really confusing when you have 6 of them open and all of a sudden Mail goes from spot 6 to spot 2. Any ideas how to get this switching of places to stop?
0
11,351,432
07/05/2012 19:42:05
745,266
05/09/2011 13:57:31
85
10
GMX's "Text Pattern Profiler" blocks transactional emails in English
My web application is sending transactional emails to its users (like "You received a payment", "Please activate your account", "Your article has been sold"). GMX users report regularly that those emails are marked as SPAM because of the "Text Pattern Profiler". I can reproduce the problem with my own account, but only emails in English are affected, German emails from my web application are delivered without problems. So I am pretty sure that the content must be the problem (as "Text Pattern Profiler" already sais :) ), but I don't know how to solve it. Is there anything I can do?
email
spam
email-spam
sendgrid
transactional-email
null
open
GMX's "Text Pattern Profiler" blocks transactional emails in English === My web application is sending transactional emails to its users (like "You received a payment", "Please activate your account", "Your article has been sold"). GMX users report regularly that those emails are marked as SPAM because of the "Text Pattern Profiler". I can reproduce the problem with my own account, but only emails in English are affected, German emails from my web application are delivered without problems. So I am pretty sure that the content must be the problem (as "Text Pattern Profiler" already sais :) ), but I don't know how to solve it. Is there anything I can do?
0
11,351,435
07/05/2012 19:42:13
545,330
12/16/2010 21:07:57
597
26
Sunspot and Advanced Association Search
My app has `Machines` that have and belong to many `Specifications` class Machine < ActiveRecord::Base has_and_belongs_to_many :specs Specifications have both `field` (width, weight, capacity, horsepower) and `value` attributes. The search is done entirely through Solr through Sunspot. I'd like to be able to find a Machine based on its Specifications, such as find all machines with Width greater than 50. I know I can index `spec_field` and `spec_value`separately, but it will filter for specs with value more than 50, which could include fields I don't want, such as height or capacity (so searching for width > 50 will yield capacity > 50 in results). Ideally, I'd like to assign each Specification of a Machine to its own indexed field along with its value, so that my index has field such as "height" or "weight", but the specifications are flexible, and some machines have one set of specs while another machine has a different set, so it doesn't look like it can work out. Can it even be done with Solr?
ruby-on-rails
ruby
search
solr
sunspot
null
open
Sunspot and Advanced Association Search === My app has `Machines` that have and belong to many `Specifications` class Machine < ActiveRecord::Base has_and_belongs_to_many :specs Specifications have both `field` (width, weight, capacity, horsepower) and `value` attributes. The search is done entirely through Solr through Sunspot. I'd like to be able to find a Machine based on its Specifications, such as find all machines with Width greater than 50. I know I can index `spec_field` and `spec_value`separately, but it will filter for specs with value more than 50, which could include fields I don't want, such as height or capacity (so searching for width > 50 will yield capacity > 50 in results). Ideally, I'd like to assign each Specification of a Machine to its own indexed field along with its value, so that my index has field such as "height" or "weight", but the specifications are flexible, and some machines have one set of specs while another machine has a different set, so it doesn't look like it can work out. Can it even be done with Solr?
0
11,351,440
07/05/2012 19:42:32
232,593
12/16/2009 02:16:17
23,210
950
Working directory diff with Git Extensions
Is there a simple way to get a diff on the working directory using the [Git Extensions](http://code.google.com/p/gitextensions/) UI (besides the Commit dialog)? It feels like View Diff should allow me to diff between my working directory and a commit version. However it seems to only want to show me my commit history. I am a recovering [Tortoise Git](http://code.google.com/p/tortoisegit/) user, and I'm used to having a "Working Directory" pseduo-commit in my commit log UI. Is there anything in Git Extensions that works similarly to this?
git
git-extensions
null
null
null
null
open
Working directory diff with Git Extensions === Is there a simple way to get a diff on the working directory using the [Git Extensions](http://code.google.com/p/gitextensions/) UI (besides the Commit dialog)? It feels like View Diff should allow me to diff between my working directory and a commit version. However it seems to only want to show me my commit history. I am a recovering [Tortoise Git](http://code.google.com/p/tortoisegit/) user, and I'm used to having a "Working Directory" pseduo-commit in my commit log UI. Is there anything in Git Extensions that works similarly to this?
0
11,351,441
07/05/2012 19:42:38
953,545
09/19/2011 21:08:58
1
0
svg to image on demand
I have javascript code that generates svg image tags on the fly when a person lands on one of the pages. Im using the [d3 library][1] to help make the image. The only problem is that d3 is not fully IE compatible and I would want to generate a .png, jpg, gif or any other image file based on the svg file. Is there a known way to do this? The server side code is PHP based, and we use node.js, and render.js for a lot of the dynamic content. [1]: http://mbostock.github.com/d3/ex/bubble.html
php
node.js
svg
d3.js
jquery-svg
null
open
svg to image on demand === I have javascript code that generates svg image tags on the fly when a person lands on one of the pages. Im using the [d3 library][1] to help make the image. The only problem is that d3 is not fully IE compatible and I would want to generate a .png, jpg, gif or any other image file based on the svg file. Is there a known way to do this? The server side code is PHP based, and we use node.js, and render.js for a lot of the dynamic content. [1]: http://mbostock.github.com/d3/ex/bubble.html
0
11,351,442
07/05/2012 19:42:40
1,505,027
07/05/2012 19:36:05
1
0
Any idea why .addClass doesn't apply? jQuery
(function (){ var stones = parseInt($('body').attr('data-site')) + 1, theul = $(".submenu > ul li:nth-child(" + stones + ")"); console.log(theul); $('theul').addClass('active'); console.log(theul); })(); Logs shows the exact same thing before and after adding the class. ![console.log] http://i.stack.imgur.com/Vlcfw.png
jquery
addclass
null
null
null
null
open
Any idea why .addClass doesn't apply? jQuery === (function (){ var stones = parseInt($('body').attr('data-site')) + 1, theul = $(".submenu > ul li:nth-child(" + stones + ")"); console.log(theul); $('theul').addClass('active'); console.log(theul); })(); Logs shows the exact same thing before and after adding the class. ![console.log] http://i.stack.imgur.com/Vlcfw.png
0
11,351,443
07/05/2012 19:42:41
218,471
11/25/2009 10:20:05
1,364
20
How to export slots and accessors from List classes?
This is my class's package: (in-package :cl-user) (defpackage foo (:use :cl) (:export :bar)) (in-package :foo) (defclass bar () (baz)) I can create an instance of `bar` in package `cl-user`. CL-USER> (defvar f) F CL-USER> (setf f (make-instance foo:bar)) #<FOO:BAR {10044340C3}> But I can't access the member `baz`. Calling `slot-value` like so ... CL-USER> (slot-value f 'baz) ... results in this error message: When attempting to read the slot's value (slot-value), the slot BAZ is missing from the object #<FOO:BAR {10044340C3}>. [Condition of type SIMPLE-ERROR] I already tried to add `baz` to the `:export` list but that does not work either. How to export slots and accessors from packages?
lisp
common-lisp
sbcl
clos
null
null
open
How to export slots and accessors from List classes? === This is my class's package: (in-package :cl-user) (defpackage foo (:use :cl) (:export :bar)) (in-package :foo) (defclass bar () (baz)) I can create an instance of `bar` in package `cl-user`. CL-USER> (defvar f) F CL-USER> (setf f (make-instance foo:bar)) #<FOO:BAR {10044340C3}> But I can't access the member `baz`. Calling `slot-value` like so ... CL-USER> (slot-value f 'baz) ... results in this error message: When attempting to read the slot's value (slot-value), the slot BAZ is missing from the object #<FOO:BAR {10044340C3}>. [Condition of type SIMPLE-ERROR] I already tried to add `baz` to the `:export` list but that does not work either. How to export slots and accessors from packages?
0
11,351,445
07/05/2012 19:42:56
1,181,172
01/31/2012 19:28:20
1
1
Authoring jQuery Plugin that Requires Other Plugins
I'm currently authoring a jQuery plugin which will require another plugin to work (specifically, [Ben Alman's doTimeout][1] **What is the best practice to specify another plugin as a dependency in my project?** If I were to upload my project to github... is it appropriate to include a copy of [doTimeout][1] in my repo? Is this purely a matter of documentation? I've tried to find this answer via google and stackoverflow, but haven't really found the answer I'm looking for. I'm sure this has already been asked somewhere, so I apologize in advance. [1]: https://github.com/cowboy/jquery-dotimeout/ "jquery-dotimeout"
jquery
jquery-plugins
null
null
null
null
open
Authoring jQuery Plugin that Requires Other Plugins === I'm currently authoring a jQuery plugin which will require another plugin to work (specifically, [Ben Alman's doTimeout][1] **What is the best practice to specify another plugin as a dependency in my project?** If I were to upload my project to github... is it appropriate to include a copy of [doTimeout][1] in my repo? Is this purely a matter of documentation? I've tried to find this answer via google and stackoverflow, but haven't really found the answer I'm looking for. I'm sure this has already been asked somewhere, so I apologize in advance. [1]: https://github.com/cowboy/jquery-dotimeout/ "jquery-dotimeout"
0
11,351,447
07/05/2012 19:43:08
1,504,967
07/05/2012 19:08:12
1
0
change link color of <a> when hover over <tr>
When I hover over 'tr', the color of the 'a' element should change to white. I tried with jQuery something like that: <scipt> $('tr').hover(function(){ $('a').css('color','white'); }); </script> But this changes the text color for all 'tr'. Any idea? ![html & css code:][1] [1]: http://i.stack.imgur.com/1zsr5.png
jquery
html
css
null
null
null
open
change link color of <a> when hover over <tr> === When I hover over 'tr', the color of the 'a' element should change to white. I tried with jQuery something like that: <scipt> $('tr').hover(function(){ $('a').css('color','white'); }); </script> But this changes the text color for all 'tr'. Any idea? ![html & css code:][1] [1]: http://i.stack.imgur.com/1zsr5.png
0
11,351,448
07/05/2012 19:43:09
505,990
11/12/2010 16:23:27
188
10
How to get mouse position using .NET
Im developing a WINDOWS SERVICE that is just suposed to log the mouse position every 10 sec. The problem is that i cant get the mouse position... i call user32 for the method "GetCursorPos(ref Point)" but i always get |0,0| can anyone tell me how to properly get the position?
windows
windows-services
position
mouse
null
null
open
How to get mouse position using .NET === Im developing a WINDOWS SERVICE that is just suposed to log the mouse position every 10 sec. The problem is that i cant get the mouse position... i call user32 for the method "GetCursorPos(ref Point)" but i always get |0,0| can anyone tell me how to properly get the position?
0
11,351,450
07/05/2012 19:43:19
515,774
11/22/2010 07:59:12
379
1
Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query
I get the above error in one of my sql 2000 stored procedure. Here I do not use any variables with type ntext. I do not know why I get this error. Can some one help?
sql-server
null
null
null
null
null
open
Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query === I get the above error in one of my sql 2000 stored procedure. Here I do not use any variables with type ntext. I do not know why I get this error. Can some one help?
0
11,351,451
07/05/2012 19:43:19
1,320,771
04/08/2012 20:42:04
21
0
Improve speed of SQL Inserts into XML column from JDBC (SQL Server)
I am currently writing a Java program which loops through a folder of around 4000 XML files. Using a for loop, it extracts the XML from each file, assigns it to a String 'xmlContent', and uses the PreparedStatement method setString(2,xmlContent) to insert the String into a table stored in my SQL Server. The column '2' is a column called 'Data' of type XML. The process works, but it is slow. It inserts about 50 rows into the table every 7 seconds. Does anyone have any ideas as to how I could speed up this process? Code: { ...declaration, connection etc etc PreparedStatement ps = con.prepareStatement("INSERT INTO Table(ID,Data) VALUES(?,?)"); for (File current : folder.listFiles()){ if (current.isFile()){ xmlContent = fileRead(current.getAbsoluteFile()); ps.setString(1, current.getAbsoluteFile()); ps.setString(2, xmlContent); ps.addBatch(); if (++count % batchSize == 0){ ps.executeBatch(); } } } ps.executeBatch(); // performs insertion of leftover rows ps.close(); } ------ private static String fileRead(File file){ StringBuilder xmlContent = new StringBuilder(); FileReader fr = new FileReader(file); BufferedReader br = new BufferedReader(fr); String strLine = ""; br.readLine(); //removes encoding line, don't need it and causes problems while ( (strLine = br.readLine() ) != null){ xmlContent.append(strLine); } fr.close(); return xmlContent.toString(); }
java
xml
performance
sql-server-2008
jdbc
null
open
Improve speed of SQL Inserts into XML column from JDBC (SQL Server) === I am currently writing a Java program which loops through a folder of around 4000 XML files. Using a for loop, it extracts the XML from each file, assigns it to a String 'xmlContent', and uses the PreparedStatement method setString(2,xmlContent) to insert the String into a table stored in my SQL Server. The column '2' is a column called 'Data' of type XML. The process works, but it is slow. It inserts about 50 rows into the table every 7 seconds. Does anyone have any ideas as to how I could speed up this process? Code: { ...declaration, connection etc etc PreparedStatement ps = con.prepareStatement("INSERT INTO Table(ID,Data) VALUES(?,?)"); for (File current : folder.listFiles()){ if (current.isFile()){ xmlContent = fileRead(current.getAbsoluteFile()); ps.setString(1, current.getAbsoluteFile()); ps.setString(2, xmlContent); ps.addBatch(); if (++count % batchSize == 0){ ps.executeBatch(); } } } ps.executeBatch(); // performs insertion of leftover rows ps.close(); } ------ private static String fileRead(File file){ StringBuilder xmlContent = new StringBuilder(); FileReader fr = new FileReader(file); BufferedReader br = new BufferedReader(fr); String strLine = ""; br.readLine(); //removes encoding line, don't need it and causes problems while ( (strLine = br.readLine() ) != null){ xmlContent.append(strLine); } fr.close(); return xmlContent.toString(); }
0
11,351,454
07/05/2012 19:43:40
432,782
08/27/2010 09:58:22
1,423
34
How to prevent duplicate ABRecordRef instances?
Some of the beta users of [my app][1] are reporting that their list of contacts contains a lot of duplicate entries. At first I thought this was an organization issue, of people actually having the same duplicate entries in their address books, but something else is going on. I'm using [`ABAddressBookCopyArrayOfAllPeople`][2] to get at a list of `ABRecordRef` instances, but the results seem to differ from the [`ABPeoplePickerNavigationController`][3]. When looking at one of the duplicate contacts in the Contacts app, it turns out that these contacts have multiple cards associated with or linked to them. This is a screenshot from a Dutch iPhone. Mind the 'linked cards' circled in red: ![Screenshot][4] **Does anyone know how to deal with or detect these linked cards?** The iPhone this screenshot originated from shows the same issue in WhatsApp, so it seems I'm not the only developer with this issue. Thanks! EP. [1]: http://twelvetwenty.nl/gettogether [2]: https://developer.apple.com/library/ios/#documentation/AddressBook/Reference/ABPersonRef_iPhoneOS/Reference/reference.html#//apple_ref/c/func/ABAddressBookCopyArrayOfAllPeople [3]: https://developer.apple.com/library/ios/#documentation/AddressBookUI/Reference/ABPeoplePickerNavigationController_Class/Reference/Reference.html [4]: http://i.stack.imgur.com/axaNa.png
objective-c
cocoa-touch
duplicates
abaddressbook
abrecord
null
open
How to prevent duplicate ABRecordRef instances? === Some of the beta users of [my app][1] are reporting that their list of contacts contains a lot of duplicate entries. At first I thought this was an organization issue, of people actually having the same duplicate entries in their address books, but something else is going on. I'm using [`ABAddressBookCopyArrayOfAllPeople`][2] to get at a list of `ABRecordRef` instances, but the results seem to differ from the [`ABPeoplePickerNavigationController`][3]. When looking at one of the duplicate contacts in the Contacts app, it turns out that these contacts have multiple cards associated with or linked to them. This is a screenshot from a Dutch iPhone. Mind the 'linked cards' circled in red: ![Screenshot][4] **Does anyone know how to deal with or detect these linked cards?** The iPhone this screenshot originated from shows the same issue in WhatsApp, so it seems I'm not the only developer with this issue. Thanks! EP. [1]: http://twelvetwenty.nl/gettogether [2]: https://developer.apple.com/library/ios/#documentation/AddressBook/Reference/ABPersonRef_iPhoneOS/Reference/reference.html#//apple_ref/c/func/ABAddressBookCopyArrayOfAllPeople [3]: https://developer.apple.com/library/ios/#documentation/AddressBookUI/Reference/ABPeoplePickerNavigationController_Class/Reference/Reference.html [4]: http://i.stack.imgur.com/axaNa.png
0
11,628,681
07/24/2012 10:13:47
1,113,542
12/23/2011 14:22:23
503
29
iReport: Report from crosstab with datasource as the OLAP cube + MDX Query?
I am trying to create report from the OLAP cube as the datasource in iReports. I am using following MDX query for my data select CROSSJOIN(HealthCheckStatusD.Members, Measures.Patient) ON Columns, NONEMPTYCROSSJOIN(ChannelD.Members,HealthCheckDateD.Members) ON Rows from CubeReport2 and after that I am making crosstab and taking HealthCheckDate + ChannelName in rows and HealthCheckStatus in columns and selecting Patient count as meansure. But when I am trying to execute the report I am getting following exception Error filling print... No such tuple ([Measures].[Patient] on axis 0. net.sf.jasperreports.engine.JRRuntimeException: No such tuple ([Measures].[Patient] on axis 0.     at net.sf.jasperreports.olap.JROlapDataSource.getTuplePosition(JROlapDataSource.java:724     at net.sf.jasperreports.olap.mapping.MappingParser.axisPosition(MappingParser.java:601)      at net.sf.jasperreports.olap.mapping.MappingParser.axisPositions(MappingParser.java:550)      at net.sf.jasperreports.olap.mapping.MappingParser.dataMapping(MappingParser.java:233)      at net.sf.jasperreports.olap.mapping.MappingParser.mapping(MappingParser.java:139)      at net.sf.jasperreports.olap.JROlapDataSource.init(JROlapDataSource.java:322)      at net.sf.jasperreports.olap.JROlapDataSource.<init>(JROlapDataSource.java:122)      at net.sf.jasperreports.olap.JRMondrianDataSource.<init>(JRMondrianDataSource.java:41)      at net.sf.jasperreports.olap.JRMondrianQueryExecuter.createDatasource(JRMondrianQueryExecuter.java:103)      at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1073)      at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:667)      at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1235)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:859)      at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:126)      at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:464)      at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:300)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:757)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:988)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)     at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)  Print not filled. Try to use an EmptyDataSource... Where as this MDX query is working fine in OLAP designer... help me out..in solving this issue.. How Can I frame my MDX query with is acceptable by iReport so that I can make report using crosstabs.
jasper-reports
ireport
mdx
olap
jasperserver
null
open
iReport: Report from crosstab with datasource as the OLAP cube + MDX Query? === I am trying to create report from the OLAP cube as the datasource in iReports. I am using following MDX query for my data select CROSSJOIN(HealthCheckStatusD.Members, Measures.Patient) ON Columns, NONEMPTYCROSSJOIN(ChannelD.Members,HealthCheckDateD.Members) ON Rows from CubeReport2 and after that I am making crosstab and taking HealthCheckDate + ChannelName in rows and HealthCheckStatus in columns and selecting Patient count as meansure. But when I am trying to execute the report I am getting following exception Error filling print... No such tuple ([Measures].[Patient] on axis 0. net.sf.jasperreports.engine.JRRuntimeException: No such tuple ([Measures].[Patient] on axis 0.     at net.sf.jasperreports.olap.JROlapDataSource.getTuplePosition(JROlapDataSource.java:724     at net.sf.jasperreports.olap.mapping.MappingParser.axisPosition(MappingParser.java:601)      at net.sf.jasperreports.olap.mapping.MappingParser.axisPositions(MappingParser.java:550)      at net.sf.jasperreports.olap.mapping.MappingParser.dataMapping(MappingParser.java:233)      at net.sf.jasperreports.olap.mapping.MappingParser.mapping(MappingParser.java:139)      at net.sf.jasperreports.olap.JROlapDataSource.init(JROlapDataSource.java:322)      at net.sf.jasperreports.olap.JROlapDataSource.<init>(JROlapDataSource.java:122)      at net.sf.jasperreports.olap.JRMondrianDataSource.<init>(JRMondrianDataSource.java:41)      at net.sf.jasperreports.olap.JRMondrianQueryExecuter.createDatasource(JRMondrianQueryExecuter.java:103)      at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1073)      at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:667)      at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1235)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:859)      at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:126)      at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:464)      at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:300)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:757)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:988)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)     at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)  Print not filled. Try to use an EmptyDataSource... Where as this MDX query is working fine in OLAP designer... help me out..in solving this issue.. How Can I frame my MDX query with is acceptable by iReport so that I can make report using crosstabs.
0
11,628,682
07/24/2012 10:13:47
1,529,480
07/16/2012 16:19:12
1
1
opencv with gpu crash in debug mode
I am using opencv2.4.2 with visual studio 2010 build with cmake (CUDA enabled). The problem is i consistently get a crash when accessing gpu methods/initializations while being in debug mode. It works in release mode although that too needs to be run outside visual studio otherwise some crash occur. The exception that i receive is as follows: First-chance exception at 0x76dbfbae in opencvGPUtest.exe: Microsoft C++ exception: cudaError_enum at memory location 0x00a3e258 The error is very consistent, and i have seen couple of examples over the internet with others (http://tech.groups.yahoo.com/group/OpenCV/message/77905). It is very difficult to work without debug support while working with large projects, so kindly help me fix this. Thanks,
exception
opencv
cuda
gpu
null
null
open
opencv with gpu crash in debug mode === I am using opencv2.4.2 with visual studio 2010 build with cmake (CUDA enabled). The problem is i consistently get a crash when accessing gpu methods/initializations while being in debug mode. It works in release mode although that too needs to be run outside visual studio otherwise some crash occur. The exception that i receive is as follows: First-chance exception at 0x76dbfbae in opencvGPUtest.exe: Microsoft C++ exception: cudaError_enum at memory location 0x00a3e258 The error is very consistent, and i have seen couple of examples over the internet with others (http://tech.groups.yahoo.com/group/OpenCV/message/77905). It is very difficult to work without debug support while working with large projects, so kindly help me fix this. Thanks,
0
11,628,685
07/24/2012 10:14:08
1,501,150
07/04/2012 09:36:25
21
4
Why MD5 Hash key is not matching with php generated MD5 Hash key?
In my android application I have used MD5 hash key for security of data access. I am using Email+time+"postfix" string to generate the key. It is working good. But problem is, when I am using email address which has at least one plus (+) sign like a+b@gmail.com , the server is returning "incorrect access key" message. I noticed that it is working with minus(-) , under score(_) etc sign enable email address , But it is not working with plus(+) sign enable address. I am generating MD5 Hash key with this method... public static String MD5_Hash(String s) { try { // Create MD5 Hash MessageDigest digest = java.security.MessageDigest .getInstance("MD5"); digest.update(s.getBytes()); byte messageDigest[] = digest.digest(); // Create Hex String StringBuffer hexString = new StringBuffer(); for (int i = 0; i < messageDigest.length; i++) { String h = Integer.toHexString(0xFF & messageDigest[i]); while (h.length() < 2) h = "0" + h; hexString.append(h); } return hexString.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return ""; }
android
hash
md5
null
null
null
open
Why MD5 Hash key is not matching with php generated MD5 Hash key? === In my android application I have used MD5 hash key for security of data access. I am using Email+time+"postfix" string to generate the key. It is working good. But problem is, when I am using email address which has at least one plus (+) sign like a+b@gmail.com , the server is returning "incorrect access key" message. I noticed that it is working with minus(-) , under score(_) etc sign enable email address , But it is not working with plus(+) sign enable address. I am generating MD5 Hash key with this method... public static String MD5_Hash(String s) { try { // Create MD5 Hash MessageDigest digest = java.security.MessageDigest .getInstance("MD5"); digest.update(s.getBytes()); byte messageDigest[] = digest.digest(); // Create Hex String StringBuffer hexString = new StringBuffer(); for (int i = 0; i < messageDigest.length; i++) { String h = Integer.toHexString(0xFF & messageDigest[i]); while (h.length() < 2) h = "0" + h; hexString.append(h); } return hexString.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return ""; }
0
11,628,691
07/24/2012 10:14:39
1,003,009
10/19/2011 11:15:24
77
6
Axis2 WS-Security Running on J2EE Application Server
I have Axis2 web services running in an Application Server (like jBoss, WebSphere and Weblogic) and till now I am passing the user details within a request and authenticating the user before processing it. The next step is that I want to delegate the authentication bit to the J2EE Application Server and once authenticated the application server should pass the UserPrinciple which I will be using as context to execute the request. I am not sure if I have asked the question correctly? I think I am mixing the WebContainer authentication with WS-Security stuff. Can anyone please point me to the right direction with some documentation which I can refer as start-up guide. Thanks, -- SJunejo
jboss
axis2
ws-security
websphere-7
weblogic11g
null
open
Axis2 WS-Security Running on J2EE Application Server === I have Axis2 web services running in an Application Server (like jBoss, WebSphere and Weblogic) and till now I am passing the user details within a request and authenticating the user before processing it. The next step is that I want to delegate the authentication bit to the J2EE Application Server and once authenticated the application server should pass the UserPrinciple which I will be using as context to execute the request. I am not sure if I have asked the question correctly? I think I am mixing the WebContainer authentication with WS-Security stuff. Can anyone please point me to the right direction with some documentation which I can refer as start-up guide. Thanks, -- SJunejo
0
11,628,695
07/24/2012 10:14:51
1,528,127
07/16/2012 07:03:39
8
0
Load another XHTML into the center layout, but the application not responding after three updates
I'm using PrimeFaces layout in my template.xhtml file, and in my index.xhtml I try to include a page dynamically into the center layout as I navigate in a tree. It works well but after the fourth click in the tree, the application isn't responding anymore. It updates the center page three times and after the fourth click it freezes. Here is a part of my template.xhtml: <p:layout fullPage="true"> <p:layoutUnit position="north" size="50"> <ui:insert name="header"></ui:insert> </p:layoutUnit> <p:layoutUnit position="south" size="65" resizable="true" collapsible="true"> <ui:insert name="footer"></ui:insert> </p:layoutUnit> <p:layoutUnit position="west" size="250" header="TreeMenu" resizable="true" collapsible="true"> <ui:insert name="treemenu"></ui:insert> </p:layoutUnit> <p:layoutUnit position="center"> <ui:insert name="content"></ui:insert> </p:layoutUnit> </p:layout> Here is a part of my index.xhtml: <ui:define name="treemenu"> <p:tree id="tree1" dynamic="true" value="#{treebuilder.tree}" var="node" selectionMode="single" selection="#{treebuilder.selectedNode}"> <p:ajax event="select" listener="#{treebuilder.onNodeSelection}" update=":contentpanel"></p:ajax> <p:treeNode> <h:outputText value="#{node.trzKod}"></h:outputText> </p:treeNode> </p:tree> </ui:define> <ui:define name="content"> <h:panelGroup id="contentpanel" layout="block"> <ui:include src="#{treebuilder.centerPage}"></ui:include> </h:panelGroup> </ui:define> I think that the problem is somewhere in the ajax update, but I don't know what did I wrong.
ajax
jsf
include
primefaces
null
null
open
Load another XHTML into the center layout, but the application not responding after three updates === I'm using PrimeFaces layout in my template.xhtml file, and in my index.xhtml I try to include a page dynamically into the center layout as I navigate in a tree. It works well but after the fourth click in the tree, the application isn't responding anymore. It updates the center page three times and after the fourth click it freezes. Here is a part of my template.xhtml: <p:layout fullPage="true"> <p:layoutUnit position="north" size="50"> <ui:insert name="header"></ui:insert> </p:layoutUnit> <p:layoutUnit position="south" size="65" resizable="true" collapsible="true"> <ui:insert name="footer"></ui:insert> </p:layoutUnit> <p:layoutUnit position="west" size="250" header="TreeMenu" resizable="true" collapsible="true"> <ui:insert name="treemenu"></ui:insert> </p:layoutUnit> <p:layoutUnit position="center"> <ui:insert name="content"></ui:insert> </p:layoutUnit> </p:layout> Here is a part of my index.xhtml: <ui:define name="treemenu"> <p:tree id="tree1" dynamic="true" value="#{treebuilder.tree}" var="node" selectionMode="single" selection="#{treebuilder.selectedNode}"> <p:ajax event="select" listener="#{treebuilder.onNodeSelection}" update=":contentpanel"></p:ajax> <p:treeNode> <h:outputText value="#{node.trzKod}"></h:outputText> </p:treeNode> </p:tree> </ui:define> <ui:define name="content"> <h:panelGroup id="contentpanel" layout="block"> <ui:include src="#{treebuilder.centerPage}"></ui:include> </h:panelGroup> </ui:define> I think that the problem is somewhere in the ajax update, but I don't know what did I wrong.
0
11,411,471
07/10/2012 10:34:10
1,147,909
01/13/2012 14:54:52
110
11
Changing Assembly Name Breaks My XAML Designer
When I change my assembly name in VS2010 project properties, all my views stop working in the designer and state none of my clr-namespace's can be found. Rebuilding the solution does not fix this yet I can build, run and install the solution with the assembly name changed. Is their another step I have to take to fix this?
c#
.net
wpf
visual-studio-2010
null
null
open
Changing Assembly Name Breaks My XAML Designer === When I change my assembly name in VS2010 project properties, all my views stop working in the designer and state none of my clr-namespace's can be found. Rebuilding the solution does not fix this yet I can build, run and install the solution with the assembly name changed. Is their another step I have to take to fix this?
0
11,411,472
07/10/2012 10:34:16
1,222,982
02/21/2012 09:28:26
131
4
android gridviews row height max of item
i have simple gridview. it's elements have different height. for example in row there are one small element and one bigger, next row will align to smaller element and a part of bigger element is under the second row. how can i set the height of each row of gridview to be the height of the biggest element in row?? my gridview <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/new_small_list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:numColumns="2" android:verticalSpacing="3dp" android:horizontalSpacing="3dp" android:stretchMode="columnWidth" android:gravity="center" android:cacheColorHint="@android:color/transparent" />
android
gridview
row
null
null
null
open
android gridviews row height max of item === i have simple gridview. it's elements have different height. for example in row there are one small element and one bigger, next row will align to smaller element and a part of bigger element is under the second row. how can i set the height of each row of gridview to be the height of the biggest element in row?? my gridview <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/new_small_list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:numColumns="2" android:verticalSpacing="3dp" android:horizontalSpacing="3dp" android:stretchMode="columnWidth" android:gravity="center" android:cacheColorHint="@android:color/transparent" />
0
11,411,475
07/10/2012 10:34:31
1,458,317
06/15/2012 09:38:13
13
0
How to encrypt data in Java using DES and decrypt that data into Object-c
here is my java code use des public class DES { public static String encode(String str, String key) throws Exception { byte[] rawKey=Base64.decode(key); IvParameterSpec sr=new IvParameterSpec(rawKey); DESKeySpec dks=new DESKeySpec(rawKey); SecretKeyFactory keyFactory=SecretKeyFactory.getInstance("DES"); SecretKey secretKey=keyFactory.generateSecret(dks); javax.crypto.Cipher cipher=Cipher.getInstance("DES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, secretKey, sr); byte data[]=str.getBytes("UTF8"); byte encryptedData[]=cipher.doFinal(data); return Base64.encode(encryptedData).trim(); } public static String decode(String str, String key) throws Exception { byte[] rawKey=Base64.decode(key); IvParameterSpec sr=new IvParameterSpec(rawKey); DESKeySpec dks=new DESKeySpec(rawKey); SecretKeyFactory keyFactory=SecretKeyFactory.getInstance("DES"); SecretKey secretKey=keyFactory.generateSecret(dks); Cipher cipher=Cipher.getInstance("DES/CBC/PKCS5Padding"); cipher.init(Cipher.DECRYPT_MODE, secretKey, sr); byte encryptedData[]=Base64.decode(str); byte decryptedData[]=cipher.doFinal(encryptedData); return new String(decryptedData, "UTF8").trim(); } } I'am a new of object-c and have some trouble in Ojbect-c DES, Above code is use java, I want to encrypt or decrypt a string finally get the same result in Object-c. thank you!!!
java
iphone
c++
objective-c
c
null
open
How to encrypt data in Java using DES and decrypt that data into Object-c === here is my java code use des public class DES { public static String encode(String str, String key) throws Exception { byte[] rawKey=Base64.decode(key); IvParameterSpec sr=new IvParameterSpec(rawKey); DESKeySpec dks=new DESKeySpec(rawKey); SecretKeyFactory keyFactory=SecretKeyFactory.getInstance("DES"); SecretKey secretKey=keyFactory.generateSecret(dks); javax.crypto.Cipher cipher=Cipher.getInstance("DES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, secretKey, sr); byte data[]=str.getBytes("UTF8"); byte encryptedData[]=cipher.doFinal(data); return Base64.encode(encryptedData).trim(); } public static String decode(String str, String key) throws Exception { byte[] rawKey=Base64.decode(key); IvParameterSpec sr=new IvParameterSpec(rawKey); DESKeySpec dks=new DESKeySpec(rawKey); SecretKeyFactory keyFactory=SecretKeyFactory.getInstance("DES"); SecretKey secretKey=keyFactory.generateSecret(dks); Cipher cipher=Cipher.getInstance("DES/CBC/PKCS5Padding"); cipher.init(Cipher.DECRYPT_MODE, secretKey, sr); byte encryptedData[]=Base64.decode(str); byte decryptedData[]=cipher.doFinal(encryptedData); return new String(decryptedData, "UTF8").trim(); } } I'am a new of object-c and have some trouble in Ojbect-c DES, Above code is use java, I want to encrypt or decrypt a string finally get the same result in Object-c. thank you!!!
0
11,405,911
07/10/2012 02:43:34
1,166,285
01/24/2012 04:42:36
485
30
Add exception to jquery regex
I'm using this code I stumbled upon to 'clean up' urls with jquery: .replace(/[^\w ]+/g,'') // and .replace(/ +/g,'-') The first one removes non alpha-numeric characters, while the second turns spaces into a dash My question is: Is there a way to exclude a character, in my situation, # , from this first .replace() ? Thank you.
jquery
regex
replace
null
null
null
open
Add exception to jquery regex === I'm using this code I stumbled upon to 'clean up' urls with jquery: .replace(/[^\w ]+/g,'') // and .replace(/ +/g,'-') The first one removes non alpha-numeric characters, while the second turns spaces into a dash My question is: Is there a way to exclude a character, in my situation, # , from this first .replace() ? Thank you.
0
11,405,912
07/10/2012 02:44:09
1,350,341
04/23/2012 01:56:27
16
1
How to email query output
I have a basic query, and i'd like to email the results. How can I do this at the query level? So if my query is: SELECT Store_Id, Paid_Out_Amount, Paid_Out_Comment, Paid_Out_Datetime, Update_UserName FROM Paid_Out_Tb WHERE (Store_Id = 1929) OR (Paid_Out_Amount > 50) AND (Paid_Out_Datetime BETWEEN CONVERT(DATETIME, '2012-06-01 00:00:00', 102) AND CONVERT(DATETIME, '2012-06-30 00:00:00', 102)) How would I email the output? I have a procedure to send email via smpt and the parameters are @From, @To, @Subject and @body... which works.. but I do not know how to call the procedure "SQLNOTIFY" and send the output of the above query. Thanks, AJ
sql
query
smtp
null
null
null
open
How to email query output === I have a basic query, and i'd like to email the results. How can I do this at the query level? So if my query is: SELECT Store_Id, Paid_Out_Amount, Paid_Out_Comment, Paid_Out_Datetime, Update_UserName FROM Paid_Out_Tb WHERE (Store_Id = 1929) OR (Paid_Out_Amount > 50) AND (Paid_Out_Datetime BETWEEN CONVERT(DATETIME, '2012-06-01 00:00:00', 102) AND CONVERT(DATETIME, '2012-06-30 00:00:00', 102)) How would I email the output? I have a procedure to send email via smpt and the parameters are @From, @To, @Subject and @body... which works.. but I do not know how to call the procedure "SQLNOTIFY" and send the output of the above query. Thanks, AJ
0
11,405,913
07/10/2012 02:44:13
1,513,497
07/10/2012 02:24:00
1
0
How to overload a c++ member function in lua code
I want to write some lua code to over load a callback member function in c++, how can I do that? I use tolua++ as the glue library. Thank you for your response.
c++
lua
overloading
null
null
null
open
How to overload a c++ member function in lua code === I want to write some lua code to over load a callback member function in c++, how can I do that? I use tolua++ as the glue library. Thank you for your response.
0
11,411,476
07/10/2012 10:34:33
1,230,123
02/24/2012 06:43:15
876
78
Get the div inside another div without using ID attribute in jQuery
I need to access the div with class `formErrorContent` inside the div with id `emailMsg` without putting ID attribute for the inner div. How can I achieve that? <div id="emailMsg" class="formError" style="opacity: 0.80; margin-top: 0px;display:none;" onclick="this.style.display='none';"> <div class="formErrorContent">* This field is required<br> </div> </div>
jquery
null
null
null
null
null
open
Get the div inside another div without using ID attribute in jQuery === I need to access the div with class `formErrorContent` inside the div with id `emailMsg` without putting ID attribute for the inner div. How can I achieve that? <div id="emailMsg" class="formError" style="opacity: 0.80; margin-top: 0px;display:none;" onclick="this.style.display='none';"> <div class="formErrorContent">* This field is required<br> </div> </div>
0
11,411,237
07/10/2012 10:20:05
1,514,321
07/10/2012 09:23:21
1
0
Apache DefaultHttpClient in Android
Is it save for https request? Thank you for your answer! MO
android
https
null
null
null
07/10/2012 10:27:54
not a real question
Apache DefaultHttpClient in Android === Is it save for https request? Thank you for your answer! MO
1
11,472,961
07/13/2012 14:54:11
1,523,891
07/13/2012 14:48:01
1
0
Javascript only works when with alerts
The following code loads a youtube vidéo in a player. If I remove the two "alert", it doesn't work anymore... ytplayer = document.getElementById("ytPlayer"); alert('ok'); if (ytplayer) { alert('ok'); loadVideo(url, start); } Can someone help me?
javascript
alert
null
null
null
null
open
Javascript only works when with alerts === The following code loads a youtube vidéo in a player. If I remove the two "alert", it doesn't work anymore... ytplayer = document.getElementById("ytPlayer"); alert('ok'); if (ytplayer) { alert('ok'); loadVideo(url, start); } Can someone help me?
0
11,472,962
07/13/2012 14:54:13
75,846
03/09/2009 21:36:04
779
15
Understanding the Liskov substitution principle
I am trying to nail down my understanding of the aforementioned principle and doing so by reading over and over the [wikipedia][1] entry. Putting aside the concepts of Covariance and Contravariance that still give me grief, wikipedia mentions also that invariants of the supertype must be preserved in the subtype and the History Constraint or history rule. Based on these last two concepts I came up with this small example: class Program { static void Main(string[] args) { var fooUser = new FooUser(); var fooBase = new FooBase("Serge"); var fooDerived = new FooDerived("Serge"); fooUser.Use(fooBase); //will print "Serge" fooUser.Use(fooDerived); //will print "New User" Console.ReadKey(); } } public class FooUser { public void Use(IFoo foo) { foo.DoSomething(); Console.WriteLine(foo.Name); } } public interface IFoo { string Name { get; } void DoSomething(); } public class FooBase : IFoo { public string Name { get; protected set; } public FooBase(string name) { Name = name; } public virtual void DoSomething() { } } public class FooDerived : FooBase { public FooDerived(string name) : base(name) { } public override void DoSomething() { Name = "New Name"; base.DoSomething(); } } So my question is: based on the two above mentioned concepts, am I violating the principle with this example? If not, why? Thank you very much in advance. [1]: http://en.wikipedia.org/wiki/Liskov_substitution_principle
c#
solid-principles
null
null
null
null
open
Understanding the Liskov substitution principle === I am trying to nail down my understanding of the aforementioned principle and doing so by reading over and over the [wikipedia][1] entry. Putting aside the concepts of Covariance and Contravariance that still give me grief, wikipedia mentions also that invariants of the supertype must be preserved in the subtype and the History Constraint or history rule. Based on these last two concepts I came up with this small example: class Program { static void Main(string[] args) { var fooUser = new FooUser(); var fooBase = new FooBase("Serge"); var fooDerived = new FooDerived("Serge"); fooUser.Use(fooBase); //will print "Serge" fooUser.Use(fooDerived); //will print "New User" Console.ReadKey(); } } public class FooUser { public void Use(IFoo foo) { foo.DoSomething(); Console.WriteLine(foo.Name); } } public interface IFoo { string Name { get; } void DoSomething(); } public class FooBase : IFoo { public string Name { get; protected set; } public FooBase(string name) { Name = name; } public virtual void DoSomething() { } } public class FooDerived : FooBase { public FooDerived(string name) : base(name) { } public override void DoSomething() { Name = "New Name"; base.DoSomething(); } } So my question is: based on the two above mentioned concepts, am I violating the principle with this example? If not, why? Thank you very much in advance. [1]: http://en.wikipedia.org/wiki/Liskov_substitution_principle
0
11,472,963
07/13/2012 14:54:16
644,467
03/04/2011 09:45:35
144
7
Autocomplete not working in some condtion
I am using primefaces autocomplete component with itemtip option, after getting suggestions I am selectiing one value as a example lastname, but I want to display in textbox both lastname and firstname of player, so tried in this way. `itemLabel="#{p.lastName} #{p.firstName} "` having some space with these two . <p:autoComplete id="watermark" value="#{backingBean.object}" size="40" completeMethod="#{backingBean.completeholder}" var="p" itemLabel="#{p.lastName} #{p.firstName} " itemValue="#{p}" converter="player"> <f:facet name="itemtip"> <h:panelGrid columns="2" styleClass="cellsp-panel"> <f:facet name="header"> <p:graphicImage value="#{p.imagePath}" width="60" height="60" /> </f:facet> <h:outputText value="LastName " style="font-weight:bold" /> <h:outputText id="ln" value="#{p.lastName}" /> <h:outputText value="FirstName " style="font-weight:bold" /> <h:outputText id="fn" value="#{p.firstName}" /> </h:panelGrid> </f:facet> <p:ajax event="itemSelect" update="e,c"> </p:ajax> </p:autoComplete> so after selecting a suggestion, it displays lastname and firstname of player perfectly. But one problem is created as - it creates a space in autocomplete textbox, so i need to use backspace to remove this space so that I can search a for getting suggestions. How can I overcome from this problem? 2. Also I am using watermark on autocomplete , it works only when I use single itemLabel like itemLabel="#{p.lastName} otherwise it unable to display watermark in autocomplete. 3.Also when I use for no-case sensitive input so that user can search without case sensitive, once I get any suggestions and still if try to type some keyworks for further filterations, suggestions disappears,it works if I go for case sensitive by default way. 4. User can type players lastname or firstname , and still he needs to gets suggestion ,what modifications should I need to done in following method ? I have stored lastname with First letter as a Capital, so I am using toUpperCase() in this way public List<Player> completePlayer(String query) { List<Player> suggestions = new ArrayList<Player>(); for(Player p : players) { if(p.getlastName().startsWith(query.toUpperCase())) suggestions.add(p); } return suggestions; } How can I overcome from this problem?
jsf-2.0
primefaces
null
null
null
null
open
Autocomplete not working in some condtion === I am using primefaces autocomplete component with itemtip option, after getting suggestions I am selectiing one value as a example lastname, but I want to display in textbox both lastname and firstname of player, so tried in this way. `itemLabel="#{p.lastName} #{p.firstName} "` having some space with these two . <p:autoComplete id="watermark" value="#{backingBean.object}" size="40" completeMethod="#{backingBean.completeholder}" var="p" itemLabel="#{p.lastName} #{p.firstName} " itemValue="#{p}" converter="player"> <f:facet name="itemtip"> <h:panelGrid columns="2" styleClass="cellsp-panel"> <f:facet name="header"> <p:graphicImage value="#{p.imagePath}" width="60" height="60" /> </f:facet> <h:outputText value="LastName " style="font-weight:bold" /> <h:outputText id="ln" value="#{p.lastName}" /> <h:outputText value="FirstName " style="font-weight:bold" /> <h:outputText id="fn" value="#{p.firstName}" /> </h:panelGrid> </f:facet> <p:ajax event="itemSelect" update="e,c"> </p:ajax> </p:autoComplete> so after selecting a suggestion, it displays lastname and firstname of player perfectly. But one problem is created as - it creates a space in autocomplete textbox, so i need to use backspace to remove this space so that I can search a for getting suggestions. How can I overcome from this problem? 2. Also I am using watermark on autocomplete , it works only when I use single itemLabel like itemLabel="#{p.lastName} otherwise it unable to display watermark in autocomplete. 3.Also when I use for no-case sensitive input so that user can search without case sensitive, once I get any suggestions and still if try to type some keyworks for further filterations, suggestions disappears,it works if I go for case sensitive by default way. 4. User can type players lastname or firstname , and still he needs to gets suggestion ,what modifications should I need to done in following method ? I have stored lastname with First letter as a Capital, so I am using toUpperCase() in this way public List<Player> completePlayer(String query) { List<Player> suggestions = new ArrayList<Player>(); for(Player p : players) { if(p.getlastName().startsWith(query.toUpperCase())) suggestions.add(p); } return suggestions; } How can I overcome from this problem?
0
11,472,964
07/13/2012 14:54:21
1,492,776
06/30/2012 08:52:30
40
1
save and load data
in my game i use NSUserDefults to save the user highscore. in the first time i finushed the game my highscore is set to the game score, but every time after that the score in the game is automatically set as the highscore. the weirdness here is that id my game score is 0 then my highscore is stay as the biggest score, but if in the end of some game my score is 100 is sets as highscore but a game after that if my score is 50 my highscore is sets as 50(although the score was lower then my highscore). here is my viewdidload code: highScore = [[[NSUserDefaults standardUserDefaults] objectForKey:@"HighScore"] intValue ]; highScoreLabel.text = [NSString stringWithFormat:@"%d",highScore]; here is my checkIfHighscore code: -(void)checkIfHighScore { if(gameOverScore > highScore) { highScore = gameOverScore; [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:highScore] forKey:@"HighScore"]; [[NSUserDefaults standardUserDefaults] synchronize]; } highScoreLabel.text = [NSString stringWithFormat:@"%d", highScore]; } what is the problem?
objective-c
xcode
nsuserdefaults
null
null
null
open
save and load data === in my game i use NSUserDefults to save the user highscore. in the first time i finushed the game my highscore is set to the game score, but every time after that the score in the game is automatically set as the highscore. the weirdness here is that id my game score is 0 then my highscore is stay as the biggest score, but if in the end of some game my score is 100 is sets as highscore but a game after that if my score is 50 my highscore is sets as 50(although the score was lower then my highscore). here is my viewdidload code: highScore = [[[NSUserDefaults standardUserDefaults] objectForKey:@"HighScore"] intValue ]; highScoreLabel.text = [NSString stringWithFormat:@"%d",highScore]; here is my checkIfHighscore code: -(void)checkIfHighScore { if(gameOverScore > highScore) { highScore = gameOverScore; [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:highScore] forKey:@"HighScore"]; [[NSUserDefaults standardUserDefaults] synchronize]; } highScoreLabel.text = [NSString stringWithFormat:@"%d", highScore]; } what is the problem?
0
11,471,239
07/13/2012 13:13:26
1,466,971
06/19/2012 16:11:24
17
0
Can't retrieve a value from the JSONObject
I'm passing values via PHP for this android java class(Login screen)but it's giving me a JSONException Error which I can't identify from the code below. Could someone tell me how to fix kindly? thank you in advance! **Error Logs** 07-13 08:59:27.920: E/JSON(21980): {"tag":"login","success":1,"error":0,"user":{"id":"1","employeeName":"ppp","email":"ppp","date_registered":"2012-07-12"}} 07-13 08:59:27.960: W/System.err(21980): org.json.JSONException: No value for id 07-13 08:59:27.960: W/System.err(21980): at org.json.JSONObject.get(JSONObject.java:354) 07-13 08:59:27.960: W/System.err(21980): at org.json.JSONObject.getString(JSONObject.java:510) 07-13 08:59:27.960: W/System.err(21980): at com.app.android.LoginActivity$1.onClick(LoginActivity.java:78) 07-13 08:59:27.970: W/System.err(21980): at android.view.View.performClick(View.java:3565) 07-13 08:59:27.970: W/System.err(21980): at android.view.View$PerformClick.run(View.java:14165) 07-13 08:59:27.970: W/System.err(21980): at android.os.Handler.handleCallback(Handler.java:605) 07-13 08:59:27.970: W/System.err(21980): at android.os.Handler.dispatchMessage(Handler.java:92) 07-13 08:59:27.970: W/System.err(21980): at android.os.Looper.loop(Looper.java:137) 07-13 08:59:27.970: W/System.err(21980): at android.app.ActivityThread.main(ActivityThread.java:4514) 07-13 08:59:27.970: W/System.err(21980): at java.lang.reflect.Method.invokeNative(Native Method) 07-13 08:59:27.970: W/System.err(21980): at java.lang.reflect.Method.invoke(Method.java:511) 07-13 08:59:27.970: W/System.err(21980): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980) 07-13 08:59:27.970: W/System.err(21980): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747) 07-13 08:59:27.970: W/System.err(21980): at dalvik.system.NativeStart.main(Native Method) **api.php** if (isset($_POST['tag']) && $_POST['tag'] != '') { // get tag $tag = $_POST['tag']; // include db handler require_once 'include/db_functions.php'; $db = new DB_Functions(); // response Array $response = array("tag" => $tag, "success" => 0, "error" => 0); // check for tag type if ($tag == 'login') { // Request type is check Login $uid = $_POST['id']; $password = $_POST['pswd']; // check for user $user = $db->getUserByUidAndPassword($uid, $password); if ($user != false) { // user found // echo json with success = 1 $response["success"] = 1; $response["user"]["id"] = $user["id"]; $response["user"]["name"] = $user["name"]; $response["user"]["email"] = $user["email"]; $response["user"]["date_registered"] = $user["date_registered"]; echo json_encode($response); } **LoginActivity.java** // JSON Response node names private static String KEY_SUCCESS = "success"; private static String KEY_ERROR = "error"; private static String KEY_ERROR_MSG = "error_msg"; private static String KEY_UID = "id"; private static String KEY_NAME = "name"; private static String KEY_EMAIL = "email"; private static String KEY_CREATED_AT = "date_registered"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login); // Importing all assets like buttons, text fields inputUid = (EditText) findViewById(R.id.loginUid); inputPassword = (EditText) findViewById(R.id.loginPassword); btnLogin = (Button) findViewById(R.id.btnLogin); btnLinkToRegister = (Button) findViewById(R.id.btnLinkToRegisterScreen); loginErrorMsg = (TextView) findViewById(R.id.login_error); // Login button Click Event btnLogin.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { String id = inputUid.getText().toString(); String pswd = inputPassword.getText().toString(); UserFunctions userFunction = new UserFunctions(); Log.d("Button", "Login"); JSONObject json = userFunction.loginUser(id, pswd); // check for login response try { if (json.getString(KEY_SUCCESS) != null) { loginErrorMsg.setText(""); String res = json.getString(KEY_SUCCESS); if(Integer.parseInt(res) == 1){ // user successfully logged in // Store user details in SQLite Database DatabaseHandler db = new DatabaseHandler(getApplicationContext()); JSONObject json_user = json.getJSONObject("user"); // Clear all previous data in database userFunction.logoutUser(getApplicationContext()); db.addUser(json.getString(KEY_ID), json_user.getString(KEY_NAME), json_user.getString(KEY_EMAIL), json_user.getString(KEY_CREATED_AT)); // Launch Dashboard Screen Intent dashboard = new Intent(getApplicationContext(), DashboardActivity.class); // Close all views before launching Dashboard dashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(dashboard); // Close Login Screen finish(); }else{ // Error in login loginErrorMsg.setText("Incorrect username/password"); } } } catch (JSONException e) { e.printStackTrace(); } } });
java
php
android
json
null
null
open
Can't retrieve a value from the JSONObject === I'm passing values via PHP for this android java class(Login screen)but it's giving me a JSONException Error which I can't identify from the code below. Could someone tell me how to fix kindly? thank you in advance! **Error Logs** 07-13 08:59:27.920: E/JSON(21980): {"tag":"login","success":1,"error":0,"user":{"id":"1","employeeName":"ppp","email":"ppp","date_registered":"2012-07-12"}} 07-13 08:59:27.960: W/System.err(21980): org.json.JSONException: No value for id 07-13 08:59:27.960: W/System.err(21980): at org.json.JSONObject.get(JSONObject.java:354) 07-13 08:59:27.960: W/System.err(21980): at org.json.JSONObject.getString(JSONObject.java:510) 07-13 08:59:27.960: W/System.err(21980): at com.app.android.LoginActivity$1.onClick(LoginActivity.java:78) 07-13 08:59:27.970: W/System.err(21980): at android.view.View.performClick(View.java:3565) 07-13 08:59:27.970: W/System.err(21980): at android.view.View$PerformClick.run(View.java:14165) 07-13 08:59:27.970: W/System.err(21980): at android.os.Handler.handleCallback(Handler.java:605) 07-13 08:59:27.970: W/System.err(21980): at android.os.Handler.dispatchMessage(Handler.java:92) 07-13 08:59:27.970: W/System.err(21980): at android.os.Looper.loop(Looper.java:137) 07-13 08:59:27.970: W/System.err(21980): at android.app.ActivityThread.main(ActivityThread.java:4514) 07-13 08:59:27.970: W/System.err(21980): at java.lang.reflect.Method.invokeNative(Native Method) 07-13 08:59:27.970: W/System.err(21980): at java.lang.reflect.Method.invoke(Method.java:511) 07-13 08:59:27.970: W/System.err(21980): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980) 07-13 08:59:27.970: W/System.err(21980): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747) 07-13 08:59:27.970: W/System.err(21980): at dalvik.system.NativeStart.main(Native Method) **api.php** if (isset($_POST['tag']) && $_POST['tag'] != '') { // get tag $tag = $_POST['tag']; // include db handler require_once 'include/db_functions.php'; $db = new DB_Functions(); // response Array $response = array("tag" => $tag, "success" => 0, "error" => 0); // check for tag type if ($tag == 'login') { // Request type is check Login $uid = $_POST['id']; $password = $_POST['pswd']; // check for user $user = $db->getUserByUidAndPassword($uid, $password); if ($user != false) { // user found // echo json with success = 1 $response["success"] = 1; $response["user"]["id"] = $user["id"]; $response["user"]["name"] = $user["name"]; $response["user"]["email"] = $user["email"]; $response["user"]["date_registered"] = $user["date_registered"]; echo json_encode($response); } **LoginActivity.java** // JSON Response node names private static String KEY_SUCCESS = "success"; private static String KEY_ERROR = "error"; private static String KEY_ERROR_MSG = "error_msg"; private static String KEY_UID = "id"; private static String KEY_NAME = "name"; private static String KEY_EMAIL = "email"; private static String KEY_CREATED_AT = "date_registered"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login); // Importing all assets like buttons, text fields inputUid = (EditText) findViewById(R.id.loginUid); inputPassword = (EditText) findViewById(R.id.loginPassword); btnLogin = (Button) findViewById(R.id.btnLogin); btnLinkToRegister = (Button) findViewById(R.id.btnLinkToRegisterScreen); loginErrorMsg = (TextView) findViewById(R.id.login_error); // Login button Click Event btnLogin.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { String id = inputUid.getText().toString(); String pswd = inputPassword.getText().toString(); UserFunctions userFunction = new UserFunctions(); Log.d("Button", "Login"); JSONObject json = userFunction.loginUser(id, pswd); // check for login response try { if (json.getString(KEY_SUCCESS) != null) { loginErrorMsg.setText(""); String res = json.getString(KEY_SUCCESS); if(Integer.parseInt(res) == 1){ // user successfully logged in // Store user details in SQLite Database DatabaseHandler db = new DatabaseHandler(getApplicationContext()); JSONObject json_user = json.getJSONObject("user"); // Clear all previous data in database userFunction.logoutUser(getApplicationContext()); db.addUser(json.getString(KEY_ID), json_user.getString(KEY_NAME), json_user.getString(KEY_EMAIL), json_user.getString(KEY_CREATED_AT)); // Launch Dashboard Screen Intent dashboard = new Intent(getApplicationContext(), DashboardActivity.class); // Close all views before launching Dashboard dashboard.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(dashboard); // Close Login Screen finish(); }else{ // Error in login loginErrorMsg.setText("Incorrect username/password"); } } } catch (JSONException e) { e.printStackTrace(); } } });
0
11,472,970
07/13/2012 14:54:40
74,447
03/05/2009 21:48:57
101
7
Issues with Crypto.generateMac() in SalesForce APEX
We need to make a few callouts to a service that is using OAuth 1.0 and requires each request to be signed with HMAC-SHA1. The service doesn't have any APEX client API. Thus, we have to do it manually. Unfortunately, EncodingUtil.base64Encode(Crypto.generateMac('hmacSHA1', Blob.valueOf(data), Blob.valueOf(key))); returns a different string from what we expect. We have compared the output for the same input with libraries for other languages. And the output was different.
oauth
salesforce
force.com
null
null
null
open
Issues with Crypto.generateMac() in SalesForce APEX === We need to make a few callouts to a service that is using OAuth 1.0 and requires each request to be signed with HMAC-SHA1. The service doesn't have any APEX client API. Thus, we have to do it manually. Unfortunately, EncodingUtil.base64Encode(Crypto.generateMac('hmacSHA1', Blob.valueOf(data), Blob.valueOf(key))); returns a different string from what we expect. We have compared the output for the same input with libraries for other languages. And the output was different.
0
11,472,954
07/13/2012 14:53:34
983,969
10/07/2011 12:21:09
141
4
Stlying Between Resolution
Im doing some simple styling between different mobile devices and was wondering whats the best way to change depending on the resolution. As my application looks fine on low resolution devices, but on high the fonts to small and other things are to small as well. I was thinking of one style sheet depending on resolution but was wondering if this was the best way or is there better ways to implemented this situations. The devices are all blackberry from new to old hence the high and low resolution. Is there anyway even just to scale content up if the screens bigger? Thanks
html
css
mobile
dynamic
resolution
null
open
Stlying Between Resolution === Im doing some simple styling between different mobile devices and was wondering whats the best way to change depending on the resolution. As my application looks fine on low resolution devices, but on high the fonts to small and other things are to small as well. I was thinking of one style sheet depending on resolution but was wondering if this was the best way or is there better ways to implemented this situations. The devices are all blackberry from new to old hence the high and low resolution. Is there anyway even just to scale content up if the screens bigger? Thanks
0
11,472,955
07/13/2012 14:53:36
1,125,394
01/01/2012 20:49:24
567
13
jquerymobile: button stays unlightened after popup
http://jsfiddle.net/ca11111/gf7W7/ in this example, the share button in the navbarn shows a popup when you close the popup, the button remains in an "unlightened" state I would like to get back to a normal state (like initially) when I close the popup It's a sort of hasFocus state, because if you click elsewhere in the page it can
jquery
css
jquery-mobile
popup
null
null
open
jquerymobile: button stays unlightened after popup === http://jsfiddle.net/ca11111/gf7W7/ in this example, the share button in the navbarn shows a popup when you close the popup, the button remains in an "unlightened" state I would like to get back to a normal state (like initially) when I close the popup It's a sort of hasFocus state, because if you click elsewhere in the page it can
0
11,411,428
07/10/2012 10:31:54
171,461
09/10/2009 14:07:32
21,620
686
Quick way to know if a file is open on Linux?
Is there a quick way (i.e. that minimizes time-to-answer) to find out if a file is open on Linux? Let's say I have a process that writes a ton a files in a directory and another process which reads those files **once** they are finished writing, can the latter process know if a file is still being written to by the former process? A Python based solution would be ideal, if possible. **Note:** I understand I could be using a FIFO / Queue based solution but I am looking for something else.
python
linux
null
null
null
null
open
Quick way to know if a file is open on Linux? === Is there a quick way (i.e. that minimizes time-to-answer) to find out if a file is open on Linux? Let's say I have a process that writes a ton a files in a directory and another process which reads those files **once** they are finished writing, can the latter process know if a file is still being written to by the former process? A Python based solution would be ideal, if possible. **Note:** I understand I could be using a FIFO / Queue based solution but I am looking for something else.
0
11,411,436
07/10/2012 10:32:13
309,834
01/13/2009 12:14:25
811
8
Which one is better octopus or msdeploy for auto deployment on multiple servers using teamcity
I have looked into both. Would like your suggestions as to which one is better for automated web deployment on multiple servers.
deployment
msbuild
teamcity
msdeploy
null
null
open
Which one is better octopus or msdeploy for auto deployment on multiple servers using teamcity === I have looked into both. Would like your suggestions as to which one is better for automated web deployment on multiple servers.
0
11,411,438
07/10/2012 10:32:19
53,321
01/09/2009 13:05:36
1,112
48
Output curly brace in JSF h:outputText
I want to use the following EL inside a custom component: <ui:param name="valueAfter" value="#{not empty valueAfter ? valueAfter : false}" /> <h:outputText value="#{x.label}#{valueAfter == true ? {x.value} : ''}" /> This does not work as I cannot output the curly braces around `x.value` but now I am looking for a good way to actually output those.
jsf
el
null
null
null
null
open
Output curly brace in JSF h:outputText === I want to use the following EL inside a custom component: <ui:param name="valueAfter" value="#{not empty valueAfter ? valueAfter : false}" /> <h:outputText value="#{x.label}#{valueAfter == true ? {x.value} : ''}" /> This does not work as I cannot output the curly braces around `x.value` but now I am looking for a good way to actually output those.
0
11,411,486
07/10/2012 10:35:20
970,349
09/29/2011 04:21:14
134
7
Get IPv4 and IPv6 address of local machine c#
I am developing a windows application and I need to find the IPv4 and IPv6 address of local machine. OS can be XP or Windows 7. I got a solution for getting MAC address like, string GetMACAddress() { var macAddr = ( from nic in NetworkInterface.GetAllNetworkInterfaces() where nic.OperationalStatus == OperationalStatus.Up select nic.GetPhysicalAddress().ToString() ).FirstOrDefault(); return macAddr.ToString(); } This is working in all OS. What is the correct way to get IPv4 and IPv6 address that work on XP and WINDOWS 7? Thanks in advance.
c#
.net
winforms
windows-applications
null
null
open
Get IPv4 and IPv6 address of local machine c# === I am developing a windows application and I need to find the IPv4 and IPv6 address of local machine. OS can be XP or Windows 7. I got a solution for getting MAC address like, string GetMACAddress() { var macAddr = ( from nic in NetworkInterface.GetAllNetworkInterfaces() where nic.OperationalStatus == OperationalStatus.Up select nic.GetPhysicalAddress().ToString() ).FirstOrDefault(); return macAddr.ToString(); } This is working in all OS. What is the correct way to get IPv4 and IPv6 address that work on XP and WINDOWS 7? Thanks in advance.
0
11,405,480
07/10/2012 01:33:11
1,072,605
11/30/2011 03:35:48
1
0
How to send slideshow with text in MMS?
private void slideShow(File f1,File f2){ ArrayList<Uri> uris = new ArrayList<Uri>(); final Intent mmsIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); mmsIntent.setType("*/*"); mmsIntent.putExtra("address", "0123456"); mmsIntent.putExtra("sms_body", "the body"); uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/"+"1.jpg"))); uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/"+"2.jpg"))); uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/"+"3.jpg"))); mmsIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris); startActivity(mmsIntent); } With the above code, I can send slideshow with image in MMS, but I don't know how to add the description of the image. Are there any method that can add the description? thanks!
android
slideshow
mms
null
null
null
open
How to send slideshow with text in MMS? === private void slideShow(File f1,File f2){ ArrayList<Uri> uris = new ArrayList<Uri>(); final Intent mmsIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); mmsIntent.setType("*/*"); mmsIntent.putExtra("address", "0123456"); mmsIntent.putExtra("sms_body", "the body"); uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/"+"1.jpg"))); uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/"+"2.jpg"))); uris.add(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/"+"3.jpg"))); mmsIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris); startActivity(mmsIntent); } With the above code, I can send slideshow with image in MMS, but I don't know how to add the description of the image. Are there any method that can add the description? thanks!
0
11,411,498
07/10/2012 10:36:16
1,297,256
03/28/2012 05:46:33
16
0
constrained delauncy traingulation opencv on a contour or convexhull
I want to know the method of doing CDT(constrained delauncy triangulation) using opencv C++ / C api , on a contour or convex hull . my question is similar to http://stackoverflow.com/questions/8236201/c-objc-opencv-constrained-delaunay
opencv
constraints
triangulation
delaunay
null
null
open
constrained delauncy traingulation opencv on a contour or convexhull === I want to know the method of doing CDT(constrained delauncy triangulation) using opencv C++ / C api , on a contour or convex hull . my question is similar to http://stackoverflow.com/questions/8236201/c-objc-opencv-constrained-delaunay
0
11,411,500
07/10/2012 10:36:17
417,580
08/11/2010 18:00:26
34
0
Testing Sencha touch 2 apps
I'm looking for best practices to test Sencha Touch 2 apps. ideally, i would like to automate the execution of test sets (Via CI for example). I've Looked for test frameworks like Jasmine, JSTestdriver. There is not a lot of feedback about using those frameworks with ST2. Any ideas ?
unit-testing
testing
tdd
sencha-touch-2
null
null
open
Testing Sencha touch 2 apps === I'm looking for best practices to test Sencha Touch 2 apps. ideally, i would like to automate the execution of test sets (Via CI for example). I've Looked for test frameworks like Jasmine, JSTestdriver. There is not a lot of feedback about using those frameworks with ST2. Any ideas ?
0
11,411,501
07/10/2012 10:36:18
514,812
11/21/2010 00:57:13
70
2
Using Colorbox.js Ajax request with Google Maps
I hope someone can help me. I would like to use [Colorbox.js][1] to dynamically load a Google Map when a link is clicked. So, the map doesn't need to be preloaded unless the user decides to view a larger map. My HTML test looks as follows <!DOCTYPE html> <html> <head> <title>Map</title> </head> <body> <a href="#googlemap" id="launch_map">Check out park on Google Maps</a> <div id="location"> <div class="map"></div> </div> <!-- Google Maps API --> <script src="https://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script> <!-- Colorbox Ajax Request --> <script type="text/javascript"> $("#launch_map").colorbox({ inline: true, width:300, height:200, html:$("#location").html() }); var googleMap = $("#cboxLoadedContent").find("div.map")[0]; var latlng = new google.maps.LatLng(44.537266, 123.250760); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(googleMap, myOptions); </script> </body> </html> My issue is that it doesn't load the Google map in the Colorbox. I was hoping someone can give some insight on how I can tackle this problem. Here is a JSFilddle I created: [http://jsfiddle.net/xLGyQ/1/][2] Many thanks, WD [1]: http://www.jacklmoore.com/colorbox [2]: http://jsfiddle.net/xLGyQ/1/
javascript
jquery
google-maps
colorbox
null
null
open
Using Colorbox.js Ajax request with Google Maps === I hope someone can help me. I would like to use [Colorbox.js][1] to dynamically load a Google Map when a link is clicked. So, the map doesn't need to be preloaded unless the user decides to view a larger map. My HTML test looks as follows <!DOCTYPE html> <html> <head> <title>Map</title> </head> <body> <a href="#googlemap" id="launch_map">Check out park on Google Maps</a> <div id="location"> <div class="map"></div> </div> <!-- Google Maps API --> <script src="https://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script> <!-- Colorbox Ajax Request --> <script type="text/javascript"> $("#launch_map").colorbox({ inline: true, width:300, height:200, html:$("#location").html() }); var googleMap = $("#cboxLoadedContent").find("div.map")[0]; var latlng = new google.maps.LatLng(44.537266, 123.250760); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(googleMap, myOptions); </script> </body> </html> My issue is that it doesn't load the Google map in the Colorbox. I was hoping someone can give some insight on how I can tackle this problem. Here is a JSFilddle I created: [http://jsfiddle.net/xLGyQ/1/][2] Many thanks, WD [1]: http://www.jacklmoore.com/colorbox [2]: http://jsfiddle.net/xLGyQ/1/
0
11,411,503
07/10/2012 10:36:20
1,449,079
06/11/2012 13:52:53
18
0
Java generics and wildcards
Let's say I have these classes: class A<T> { set(T t); } class B<T> { get(T t); } class C extends A<String> { } class D extends B<String> { } class E extends A<Long> { } class F extends B<Long> { } And these variables: A<?> a1 = new C(); B<?> b1 = new D(); A<?> a2 = new E(); B<?> b2 = new F(); Can I do these somehow (with some magic?): a1.set(b1.get()); a2.set(b2.get());
java
generics
wildcard
null
null
null
open
Java generics and wildcards === Let's say I have these classes: class A<T> { set(T t); } class B<T> { get(T t); } class C extends A<String> { } class D extends B<String> { } class E extends A<Long> { } class F extends B<Long> { } And these variables: A<?> a1 = new C(); B<?> b1 = new D(); A<?> a2 = new E(); B<?> b2 = new F(); Can I do these somehow (with some magic?): a1.set(b1.get()); a2.set(b2.get());
0
11,734,866
07/31/2012 07:06:12
700,825
04/10/2011 12:35:31
658
10
"Fusing" 2 mutexing threads into 1 for execution on single core
this is a weird question, so Ill try to provide long explanation. Lets say that you are running on a single core machine. And you have 2 threads, lets say classic producer consumer problem with mutexes. Now Im wondering when running on a single core machine(so 1 core no HT): Is there a way in C++ to fuse the execution of those 2 threads into one, so that mutex can be implemented as a simple int store/load operation, instead of mutexing. For example would this work: producer code in the unified thread can be just putting stuff into circular buffer and consumer code will just read from the buffer if the current buffer_idx is higher than processed_idx. I know this seems like a stupid question, but tbh a lot of embedded stuff is still 1 core. For simplicity assume that both threads are of form while(! shutdown) { //... } Would just putting both while bodies in a big while work as expected?
c++
multithreading
mutex
null
null
null
open
"Fusing" 2 mutexing threads into 1 for execution on single core === this is a weird question, so Ill try to provide long explanation. Lets say that you are running on a single core machine. And you have 2 threads, lets say classic producer consumer problem with mutexes. Now Im wondering when running on a single core machine(so 1 core no HT): Is there a way in C++ to fuse the execution of those 2 threads into one, so that mutex can be implemented as a simple int store/load operation, instead of mutexing. For example would this work: producer code in the unified thread can be just putting stuff into circular buffer and consumer code will just read from the buffer if the current buffer_idx is higher than processed_idx. I know this seems like a stupid question, but tbh a lot of embedded stuff is still 1 core. For simplicity assume that both threads are of form while(! shutdown) { //... } Would just putting both while bodies in a big while work as expected?
0
11,734,873
07/31/2012 07:06:48
1,328,587
04/12/2012 08:48:30
107
4
Sort Design In Php
![enter image description here][1] [1]: http://i.stack.imgur.com/KHYCG.png I have designed the sorting mechanism for my site as : Now due to change in requirement , i need to add some variables which are common to all Strategy i.e ByDate , ByConsuption , By Demand. Also i need to modify the sorting string , based on output of a function for example if a function returns available then, 1.SORT BY DATE DESC => sort by available desc , DATE desc 2.SORT BY DEMAND DESC => sort by available desc , DEMAND desc Questions: IF I have some common variables/functions how can i include at one point and still it can be accessible in all classes ?
php
design-patterns
design
php5
null
null
open
Sort Design In Php === ![enter image description here][1] [1]: http://i.stack.imgur.com/KHYCG.png I have designed the sorting mechanism for my site as : Now due to change in requirement , i need to add some variables which are common to all Strategy i.e ByDate , ByConsuption , By Demand. Also i need to modify the sorting string , based on output of a function for example if a function returns available then, 1.SORT BY DATE DESC => sort by available desc , DATE desc 2.SORT BY DEMAND DESC => sort by available desc , DEMAND desc Questions: IF I have some common variables/functions how can i include at one point and still it can be accessible in all classes ?
0