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,472,920
07/13/2012 14:51:34
24,109
10/01/2008 12:21:09
2,092
88
Send signalr message from server to all clients
This is related to http://stackoverflow.com/questions/7549179/signalr-posting-a-message-to-a-hub-via-an-action-method, but my question is a bit different: I'm on version 0.5.2 of signalr, using hubs. In older versions, you were encouraged to create methods on the hub to send messages to all clients, which is what I have: public class MyHub : Hub { public void SendMessage(string message) { // Any other logic here Clients.messageRecieved(message); } ... } So in 0.5.2, I want to send a message to all the clients (say from somewhere in the controller). How can I get access to the `MyHub` instance? The only way I've seen referenced is: var hubContext = GlobalHost.ConnectionManager.GetHubContext<MyHub>(); hubContext.Clients.messageRecieved("hello"); Which is fine, but I want to call the method on my hub.
c#
asp.net-mvc
signalr
null
null
null
open
Send signalr message from server to all clients === This is related to http://stackoverflow.com/questions/7549179/signalr-posting-a-message-to-a-hub-via-an-action-method, but my question is a bit different: I'm on version 0.5.2 of signalr, using hubs. In older versions, you were encouraged to create methods on the hub to send messages to all clients, which is what I have: public class MyHub : Hub { public void SendMessage(string message) { // Any other logic here Clients.messageRecieved(message); } ... } So in 0.5.2, I want to send a message to all the clients (say from somewhere in the controller). How can I get access to the `MyHub` instance? The only way I've seen referenced is: var hubContext = GlobalHost.ConnectionManager.GetHubContext<MyHub>(); hubContext.Clients.messageRecieved("hello"); Which is fine, but I want to call the method on my hub.
0
11,472,921
07/13/2012 14:51:34
1,523,658
07/13/2012 13:22:45
1
0
why i recieve this error when I use LINQ in MVC
i have a table named Student in my linq in model folder , when i run my app. and i click on student tab this error appear on IE :(( i dont have any idea why i see this please help me...i sure my codes are true **Compiler Error Message:** CS0012: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. **Source Error:** Line 27: Line 28: Line 29: public class _Page_Views_Student_Index_cshtml : System.Web.Mvc.WebViewPage<IEnumerable<EnglishIns.Models.MyLINQDataContext>> { Line 30: Line 31: #line hidden **Source File:** c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\682ba75a\2833b27b\App_Web_index.cshtml.b4fd288c.t7qdtf0f.0.cs Line: 29
asp.net-mvc
asp.net-mvc-3
linq
linq-to-sql
asp.net-mvc-2
null
open
why i recieve this error when I use LINQ in MVC === i have a table named Student in my linq in model folder , when i run my app. and i click on student tab this error appear on IE :(( i dont have any idea why i see this please help me...i sure my codes are true **Compiler Error Message:** CS0012: The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. **Source Error:** Line 27: Line 28: Line 29: public class _Page_Views_Student_Index_cshtml : System.Web.Mvc.WebViewPage<IEnumerable<EnglishIns.Models.MyLINQDataContext>> { Line 30: Line 31: #line hidden **Source File:** c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\682ba75a\2833b27b\App_Web_index.cshtml.b4fd288c.t7qdtf0f.0.cs Line: 29
0
11,373,642
07/07/2012 08:54:12
1,472,081
06/21/2012 12:23:11
20
1
Copy Video From One location to another in Android
I m stuck with an issue that I want to copy/move a video from one location to another inside sdcard in android. does anybody know how to do that.?
android
null
null
null
null
null
open
Copy Video From One location to another in Android === I m stuck with an issue that I want to copy/move a video from one location to another inside sdcard in android. does anybody know how to do that.?
0
11,373,640
07/07/2012 08:53:43
912,935
08/25/2011 20:24:35
431
8
gdb: exited with code 030000000375
I am teaching myself to use gdb and am running some random tests. It may be worth mentioning that I am using a portable installation of MinGW on Windows 7 x64. I've created a program which I know results in a stack overflow, and as I run through it in gdb I first get two SIGSEGV signals (no surprise), and then it exits (again no surprise) with code 030000000375. Curiosity getting the best of me... what the heck is that code? I googled it and found very little. Thanks!
gdb
mingw
stackoverflow
exit-code
sigsegv
null
open
gdb: exited with code 030000000375 === I am teaching myself to use gdb and am running some random tests. It may be worth mentioning that I am using a portable installation of MinGW on Windows 7 x64. I've created a program which I know results in a stack overflow, and as I run through it in gdb I first get two SIGSEGV signals (no surprise), and then it exits (again no surprise) with code 030000000375. Curiosity getting the best of me... what the heck is that code? I googled it and found very little. Thanks!
0
11,373,648
07/07/2012 08:55:33
375,655
01/06/2010 12:25:48
741
10
Can I add/remove buttons in jWYSIWYG?
Rather than adding custom buttons to jWYSIWYG, I want to remove the add image button. Is this possible?
jquery
jwysiwyg
null
null
null
07/27/2012 00:28:24
not a real question
Can I add/remove buttons in jWYSIWYG? === Rather than adding custom buttons to jWYSIWYG, I want to remove the add image button. Is this possible?
1
11,373,649
07/07/2012 08:55:35
785,233
06/05/2011 23:57:28
1
0
Building an Online Media Streaming App
if I were to build an online media streaming service what are my best options for the backend if I want support for web client as well as mobile apps for ios and android etc I'm looking for a balance between development speed and performance thanks in advance!
android
ios
mvc
null
null
07/07/2012 21:13:08
not constructive
Building an Online Media Streaming App === if I were to build an online media streaming service what are my best options for the backend if I want support for web client as well as mobile apps for ios and android etc I'm looking for a balance between development speed and performance thanks in advance!
4
11,373,650
07/07/2012 08:55:42
1,498,415
07/03/2012 10:02:41
19
3
validateJarFile not loaded in both eclipse and netbeans
While running project in Tomcat Server i am receiving following message INFO: validateJarFile(D:\Programming\Internproject\HRDBMS\HRDB\build\web\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Can anyone help me to get out of this problem.
jsp
tomcat
servlets
null
null
null
open
validateJarFile not loaded in both eclipse and netbeans === While running project in Tomcat Server i am receiving following message INFO: validateJarFile(D:\Programming\Internproject\HRDBMS\HRDB\build\web\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Can anyone help me to get out of this problem.
0
11,373,652
07/07/2012 08:55:59
579,345
01/18/2011 02:36:16
13
0
How do I write my files to an nsbundle?
I am writing an iPhone/iPad app where I have zipped files come in which are basically the contents of a website which I can then run upon extracting. However I would like to put all these files and folders into a single file i.e. an nsbundle file so that I can display it to the user as if it were a single file and where it can then be deleted or moved but not traversed. (My app allows traversal of folders throughout the nsdocuments folder) I know that you can easily import your own nsbundle into your project and then read it into a website. But is it at all possible to write one using an already made directory structure with files and folders that must remain as they are, i.e. the web folder I described earlier? If not, do you have any other suggestions for my predicament Thanks and regards
iphone
ios
ipad
iphone-sdk-4.0
nsbundle
null
open
How do I write my files to an nsbundle? === I am writing an iPhone/iPad app where I have zipped files come in which are basically the contents of a website which I can then run upon extracting. However I would like to put all these files and folders into a single file i.e. an nsbundle file so that I can display it to the user as if it were a single file and where it can then be deleted or moved but not traversed. (My app allows traversal of folders throughout the nsdocuments folder) I know that you can easily import your own nsbundle into your project and then read it into a website. But is it at all possible to write one using an already made directory structure with files and folders that must remain as they are, i.e. the web folder I described earlier? If not, do you have any other suggestions for my predicament Thanks and regards
0
11,373,644
07/07/2012 08:54:24
118,478
06/06/2009 09:37:57
1,485
32
Performance of parsers: PEG vs LALR(1) or LL(k)
I've seen some claims that optimized PEG parsers in general cannot be faster than optimized LALR(1) or LL(k) parsers. (Of course, performance of parsing would depend on a particular grammar.) I'd like to know if there are any specific limitations of PEG parsers, either valid in general or for some subsets of PEG grammars that would make them inferior to LALR(1) or LL(k) performance-wise. In particular, I'm interested in parser generators, but assume that their output can be tweaked for performance in any particular case. I also assume that parsers are optimized and it is possible to tweak a particular grammar a bit if that's needed to improve performance.
parsing
parser-generator
lalr
ll
peg
null
open
Performance of parsers: PEG vs LALR(1) or LL(k) === I've seen some claims that optimized PEG parsers in general cannot be faster than optimized LALR(1) or LL(k) parsers. (Of course, performance of parsing would depend on a particular grammar.) I'd like to know if there are any specific limitations of PEG parsers, either valid in general or for some subsets of PEG grammars that would make them inferior to LALR(1) or LL(k) performance-wise. In particular, I'm interested in parser generators, but assume that their output can be tweaked for performance in any particular case. I also assume that parsers are optimized and it is possible to tweak a particular grammar a bit if that's needed to improve performance.
0
11,373,646
07/07/2012 08:54:45
663,660
03/17/2011 04:15:58
1,661
25
how to put button beside activity titile in android?
Hi i want to put button beside activity title in android. I can change the text using setTitle() but I haven't find anything which allows to put button beside title of Activity. I am using android 4.0.3. Can anybody help me? ![enter image description here][1] [1]: http://i.stack.imgur.com/V2aWm.png
java
android
android-layout
null
null
null
open
how to put button beside activity titile in android? === Hi i want to put button beside activity title in android. I can change the text using setTitle() but I haven't find anything which allows to put button beside title of Activity. I am using android 4.0.3. Can anybody help me? ![enter image description here][1] [1]: http://i.stack.imgur.com/V2aWm.png
0
11,373,647
07/07/2012 08:55:29
1,242,818
03/01/2012 14:03:13
23
0
How to modified url link in joomla 1.7
I am using joomla 1.7 . I have added sub menu using joomla. But when i click sub menu link its redirect to Url "www.xyz.com/2012-07-07/xyz". i want to remove date in this Url. Plz Help me . Thanks
joomla
content-management-system
null
null
null
null
open
How to modified url link in joomla 1.7 === I am using joomla 1.7 . I have added sub menu using joomla. But when i click sub menu link its redirect to Url "www.xyz.com/2012-07-07/xyz". i want to remove date in this Url. Plz Help me . Thanks
0
11,373,657
07/07/2012 08:57:21
1,490,535
06/29/2012 07:13:22
11
0
how to retrive array of images from plist file which is display in imageview
I am beginner of iPhone. I have taken the plist file in that take array of images... in that pass five images but how to retrive this images in our view.. my code is... - (void)viewDidLoad { [super viewDidLoad]; NSString *path=[[NSBundle mainBundle] pathForResource:@"Animalfile" ofType:@"plist"]; NSArray *animalImages=[NSArray arrayWithContentsOfFile:path]; NSMutableArray *animal=[[NSMutableArray alloc]init]; for(int i=0;i<[animalImages count];i++) { UIImage *img=[animalImages objectAtIndex:i]; [animalphoto setImage:img]; NSLog(@"print:%@",i); //NSString *name=[animalImages objectAtIndex:i]; [animal addObject:[UIImage imageNamed:[NSString stringWithFormat:@"%@.png",img]]]; } } give any suggestion and source code which is apply in my code
objective-c
null
null
null
null
null
open
how to retrive array of images from plist file which is display in imageview === I am beginner of iPhone. I have taken the plist file in that take array of images... in that pass five images but how to retrive this images in our view.. my code is... - (void)viewDidLoad { [super viewDidLoad]; NSString *path=[[NSBundle mainBundle] pathForResource:@"Animalfile" ofType:@"plist"]; NSArray *animalImages=[NSArray arrayWithContentsOfFile:path]; NSMutableArray *animal=[[NSMutableArray alloc]init]; for(int i=0;i<[animalImages count];i++) { UIImage *img=[animalImages objectAtIndex:i]; [animalphoto setImage:img]; NSLog(@"print:%@",i); //NSString *name=[animalImages objectAtIndex:i]; [animal addObject:[UIImage imageNamed:[NSString stringWithFormat:@"%@.png",img]]]; } } give any suggestion and source code which is apply in my code
0
11,373,658
07/07/2012 08:57:52
457,059
09/24/2010 08:50:05
707
36
android: Fail to connect to camera service on targetSdkVersion change
I had following settings in my camera apps manifest.xml: <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8" /> Now I changed it to that: <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="13" /> Problem is: My app is not able to open the camera anymore. This line throws the error: this.camera = Camera.open(); Errormessage: > Fail to connect to camera service Weird thing, by the way: After starting the app with the new setting, I don't get the camera device running anymore (all other photo apps are crashing at startup too). I have to restart the device to be able to use the camera again.
android
android-camera
null
null
null
null
open
android: Fail to connect to camera service on targetSdkVersion change === I had following settings in my camera apps manifest.xml: <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8" /> Now I changed it to that: <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="13" /> Problem is: My app is not able to open the camera anymore. This line throws the error: this.camera = Camera.open(); Errormessage: > Fail to connect to camera service Weird thing, by the way: After starting the app with the new setting, I don't get the camera device running anymore (all other photo apps are crashing at startup too). I have to restart the device to be able to use the camera again.
0
11,373,659
07/07/2012 08:57:55
1,496,823
07/02/2012 18:10:36
1
0
How to create dynamic editable table in Drupal?
I want to create **dynamic editable tables** in **Drupal 7**. But I'm not able to find any modules. Please help me!
drupal
drupal-7
drupal-modules
dynamic-tables
null
null
open
How to create dynamic editable table in Drupal? === I want to create **dynamic editable tables** in **Drupal 7**. But I'm not able to find any modules. Please help me!
0
11,373,663
07/07/2012 08:59:08
775,846
05/30/2011 06:55:05
14
7
Is this possible to take pictures without bringing the camera appliation into foreground in blackberry.....?
I am developing an application which make use of camera...and my app's requirement is : I have to take pictures from my "already running" background application ; but I have to keep camera application into background......means I want to capture picture without disturbing the forground applications. and in addition without making any camera shutter sound....??? Is this possible If we call camera app - through Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments())........... Plese help...... and give me links if there any related to this prob... thanks.
blackberry
background
camera
picture
null
null
open
Is this possible to take pictures without bringing the camera appliation into foreground in blackberry.....? === I am developing an application which make use of camera...and my app's requirement is : I have to take pictures from my "already running" background application ; but I have to keep camera application into background......means I want to capture picture without disturbing the forground applications. and in addition without making any camera shutter sound....??? Is this possible If we call camera app - through Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, new CameraArguments())........... Plese help...... and give me links if there any related to this prob... thanks.
0
11,373,664
07/07/2012 08:59:22
425,760
08/19/2010 21:11:31
47
1
Active Admin or rails_admin on separate app, linked by JSON api?
We're looking to provide an API for the content generation side of our rails app, so that it will be easy for other CMS like Drupal or Word press to plug in to the site. is it possible to configure or adapt either rails_admin or active Admin to communicate with the rails app using a JSON API, instead of having direct access to the models etc?
ruby-on-rails
json
api
content-management-system
null
null
open
Active Admin or rails_admin on separate app, linked by JSON api? === We're looking to provide an API for the content generation side of our rails app, so that it will be easy for other CMS like Drupal or Word press to plug in to the site. is it possible to configure or adapt either rails_admin or active Admin to communicate with the rails app using a JSON API, instead of having direct access to the models etc?
0
11,373,665
07/07/2012 08:59:46
1,066,828
11/26/2011 11:39:47
3,976
296
How to get Bean data in JSP
I have bean defined as `PersonBean` in session scope. What I want is find the `PersonBean.personId` in jsp page. I want it in jsp page, because I want to do some calculation based on this `personId`. Anyone have idea how to get the same. In JSP, I am able to print the same using jsf <h:outputText value="#{PersonBean.personId}" /> However I need this value assigned to some integer value in jsp as shown below. <h:outputText value="#{PersonBean.personId}" /> <% int i = new PersonBean().getPersonId; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> I thought `int i = new PersonBean().getPersonId;` would work, however it is not working. Any idea how I get get this?
jsp
jsf
jsf-2.0
javabeans
null
null
open
How to get Bean data in JSP === I have bean defined as `PersonBean` in session scope. What I want is find the `PersonBean.personId` in jsp page. I want it in jsp page, because I want to do some calculation based on this `personId`. Anyone have idea how to get the same. In JSP, I am able to print the same using jsf <h:outputText value="#{PersonBean.personId}" /> However I need this value assigned to some integer value in jsp as shown below. <h:outputText value="#{PersonBean.personId}" /> <% int i = new PersonBean().getPersonId; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ %> I thought `int i = new PersonBean().getPersonId;` would work, however it is not working. Any idea how I get get this?
0
11,651,263
07/25/2012 13:50:05
1,551,803
07/25/2012 13:42:36
1
0
How to change display message in an ExtJs Combobox?
I have an ExtJs Combobox with multiple true and I want to show "X values selected" on the input field instead of "Value 1, Value 2, Value 3". I tried with select listener but when I set the value to the input field and then you call multicombo.getValue() it takes the value from the input field. I would need something like take the value from the valueField (a hidden input). My code: var multiCombo = Ext.create('Ext.form.field.ComboBox', { renderTo: item.id, multiSelect: true, displayField: 'name', editable: false, valueField: 'id', emptyText: 'Select', hiddenName: 'data[Model][' + item.getAttribute('question-id') + '][value]', submitValue: true, inputType: 'hidden', value: selectedOptions, width: 300, store: store, queryMode: 'local', listeners: { expand: function(combo) { var values = Ext.get(combo.hiddenDataEl.dom.lastChild).dom.value; values = values.split(","); Ext.each(values, function(value, i) { values[i] = parseInt(value); }); combo.setValue(values); Ext.get(combo.getInputId()).dom.value = values.length + ' selected'; }, select: function (combo, values) { if (values[values.length - 1].data.id === parseInt(item.getAttribute('not-applicable'))) { combo.setValue(parseInt(item.getAttribute('not-applicable'))); } else { var notApplicable = -1; var newValues = combo.getValue(); if ((notApplicable = combo.getValue().indexOf(parseInt(item.getAttribute('not-applicable')))) != -1) { newValues.splice(notApplicable, 1); } combo.setValue(newValues); } Ext.get(combo.hiddenDataEl.dom.lastChild).dom.value = combo.getValue().join(','); optionsSelected = combo.getValue(); Ext.get(combo.getInputId()).dom.value = optionsSelected.length + ' selected'; }, change: function (combo) { if (item.getAttribute('required') == 'true') { if (combo.getValue().length == 0) { question.findParentNode('li', 1, true).addCls("is_required"); } else { question.findParentNode('li', 1, true).removeCls("is_required"); } //There is no ExtJs equivalent for this $('#' + combo.getInputId()).keyup(); } } } });
javascript
extjs
combobox
extjs4
multi-select
null
open
How to change display message in an ExtJs Combobox? === I have an ExtJs Combobox with multiple true and I want to show "X values selected" on the input field instead of "Value 1, Value 2, Value 3". I tried with select listener but when I set the value to the input field and then you call multicombo.getValue() it takes the value from the input field. I would need something like take the value from the valueField (a hidden input). My code: var multiCombo = Ext.create('Ext.form.field.ComboBox', { renderTo: item.id, multiSelect: true, displayField: 'name', editable: false, valueField: 'id', emptyText: 'Select', hiddenName: 'data[Model][' + item.getAttribute('question-id') + '][value]', submitValue: true, inputType: 'hidden', value: selectedOptions, width: 300, store: store, queryMode: 'local', listeners: { expand: function(combo) { var values = Ext.get(combo.hiddenDataEl.dom.lastChild).dom.value; values = values.split(","); Ext.each(values, function(value, i) { values[i] = parseInt(value); }); combo.setValue(values); Ext.get(combo.getInputId()).dom.value = values.length + ' selected'; }, select: function (combo, values) { if (values[values.length - 1].data.id === parseInt(item.getAttribute('not-applicable'))) { combo.setValue(parseInt(item.getAttribute('not-applicable'))); } else { var notApplicable = -1; var newValues = combo.getValue(); if ((notApplicable = combo.getValue().indexOf(parseInt(item.getAttribute('not-applicable')))) != -1) { newValues.splice(notApplicable, 1); } combo.setValue(newValues); } Ext.get(combo.hiddenDataEl.dom.lastChild).dom.value = combo.getValue().join(','); optionsSelected = combo.getValue(); Ext.get(combo.getInputId()).dom.value = optionsSelected.length + ' selected'; }, change: function (combo) { if (item.getAttribute('required') == 'true') { if (combo.getValue().length == 0) { question.findParentNode('li', 1, true).addCls("is_required"); } else { question.findParentNode('li', 1, true).removeCls("is_required"); } //There is no ExtJs equivalent for this $('#' + combo.getInputId()).keyup(); } } } });
0
11,651,264
07/25/2012 13:50:08
1,398,455
05/16/2012 11:07:12
53
6
MySQL groupwise max by the length of a field
`Product` table: id: int name: varchar(255) info: varchar(8000) I need to get a list of all products, grouped by name, and if some products have the same name then the one with the most data in `info` field should be picked to show. Another requirement is consistency - the same products should be guaranteed to be displayed every time. But performance isn't my concern at all with this. So the best I have come up with so far is this: select * from (select * from product order by length(info) desc) as product group by name My understanding that this *should* work in MySQL but does not guarantee the results. Is there any better way?
mysql
sql
groupwise-maximum
null
null
null
open
MySQL groupwise max by the length of a field === `Product` table: id: int name: varchar(255) info: varchar(8000) I need to get a list of all products, grouped by name, and if some products have the same name then the one with the most data in `info` field should be picked to show. Another requirement is consistency - the same products should be guaranteed to be displayed every time. But performance isn't my concern at all with this. So the best I have come up with so far is this: select * from (select * from product order by length(info) desc) as product group by name My understanding that this *should* work in MySQL but does not guarantee the results. Is there any better way?
0
11,551,036
07/18/2012 22:02:15
1,536,202
07/18/2012 21:36:58
1
0
HTML5 Canvas Uploaded Image Scale/Zoom with Buttons Coding
I am pretty much a noob with this and am trying to create 2 layers. The top layer I have as a fixed image and the bottom image is an uploaded one. I want to be able to manipulate the image on the bottom. I have a code from http://www.html5canvastutorials.com/labs/html5-canvas-scaling-a-drawing-with-plus-and-minus-buttons/#comment-19246 but I can't alter it so that the buttons would apply to the uploaded image. Here is what I have on html side, which creates the 2 layers and uploads the fixed image on top: <input type="file" id="files" name="files[]" multiple onchange="handleFileSelect(this.files)"/> <div> <input type="button" id="plus" value="+"><input type="button" id="minus" value="-"> </div> <div id="canvasesdiv" style="position:relative; width:400px; height:300px"> <canvas id="layer2" style="z-index: 1; position:absolute; left:0px; top:0px; " height="300px" width="400"> This text is displayed if your browser does not support HTML5 Canvas. </canvas> <canvas id="layer1" style="z-index: 2; position:absolute; left:0px; top:0px; " height="300px" width="400"> This text is displayed if your browser does not support HTML5 Canvas. </canvas></div> <script type="text/javascript"> var c=document.getElementById("layer1"); var ctx=c.getContext("2d"); var img=new Image(); img.onload = function(){ ctx.drawImage(img,0,0); }; img.src="assets/images/testsquare.png"; </script> This is what I have on the script side to for the altering: <script> function draw(scale, translatePos){ var canvas = document.getElementById("layer1"); var context = canvas.getContext("2d"); // clear canvas context.clearRect(0, 0, canvas.width, canvas.height); context.save(); context.restore(); } window.onload = function(){ var canvas = document.getElementById("layer1"); var translatePos = { x: canvas.width / 2, y: canvas.height / 2 }; var scale = 1.0; var scaleMultiplier = 0.8; var startDragOffset = {}; var mouseDown = false; // add button event listeners document.getElementById("plus").addEventListener("click", function(){ scale /= scaleMultiplier; draw(scale, translatePos); }, false); document.getElementById("minus").addEventListener("click", function(){ scale *= scaleMultiplier; draw(scale, translatePos); }, false); // add event listeners to handle screen drag canvas.addEventListener("mousedown", function(evt){ mouseDown = true; startDragOffset.x = evt.clientX - translatePos.x; startDragOffset.y = evt.clientY - translatePos.y; }); canvas.addEventListener("mouseup", function(evt){ mouseDown = false; }); canvas.addEventListener("mouseover", function(evt){ mouseDown = false; }); canvas.addEventListener("mouseout", function(evt){ mouseDown = false; }); canvas.addEventListener("mousemove", function(evt){ if (mouseDown) { translatePos.x = evt.clientX - startDragOffset.x; translatePos.y = evt.clientY - startDragOffset.y; draw(scale, translatePos); } }); draw(scale, translatePos); }; </script> Any help would be greatly appreciated
image
html5
canvas
zoom
scale
null
open
HTML5 Canvas Uploaded Image Scale/Zoom with Buttons Coding === I am pretty much a noob with this and am trying to create 2 layers. The top layer I have as a fixed image and the bottom image is an uploaded one. I want to be able to manipulate the image on the bottom. I have a code from http://www.html5canvastutorials.com/labs/html5-canvas-scaling-a-drawing-with-plus-and-minus-buttons/#comment-19246 but I can't alter it so that the buttons would apply to the uploaded image. Here is what I have on html side, which creates the 2 layers and uploads the fixed image on top: <input type="file" id="files" name="files[]" multiple onchange="handleFileSelect(this.files)"/> <div> <input type="button" id="plus" value="+"><input type="button" id="minus" value="-"> </div> <div id="canvasesdiv" style="position:relative; width:400px; height:300px"> <canvas id="layer2" style="z-index: 1; position:absolute; left:0px; top:0px; " height="300px" width="400"> This text is displayed if your browser does not support HTML5 Canvas. </canvas> <canvas id="layer1" style="z-index: 2; position:absolute; left:0px; top:0px; " height="300px" width="400"> This text is displayed if your browser does not support HTML5 Canvas. </canvas></div> <script type="text/javascript"> var c=document.getElementById("layer1"); var ctx=c.getContext("2d"); var img=new Image(); img.onload = function(){ ctx.drawImage(img,0,0); }; img.src="assets/images/testsquare.png"; </script> This is what I have on the script side to for the altering: <script> function draw(scale, translatePos){ var canvas = document.getElementById("layer1"); var context = canvas.getContext("2d"); // clear canvas context.clearRect(0, 0, canvas.width, canvas.height); context.save(); context.restore(); } window.onload = function(){ var canvas = document.getElementById("layer1"); var translatePos = { x: canvas.width / 2, y: canvas.height / 2 }; var scale = 1.0; var scaleMultiplier = 0.8; var startDragOffset = {}; var mouseDown = false; // add button event listeners document.getElementById("plus").addEventListener("click", function(){ scale /= scaleMultiplier; draw(scale, translatePos); }, false); document.getElementById("minus").addEventListener("click", function(){ scale *= scaleMultiplier; draw(scale, translatePos); }, false); // add event listeners to handle screen drag canvas.addEventListener("mousedown", function(evt){ mouseDown = true; startDragOffset.x = evt.clientX - translatePos.x; startDragOffset.y = evt.clientY - translatePos.y; }); canvas.addEventListener("mouseup", function(evt){ mouseDown = false; }); canvas.addEventListener("mouseover", function(evt){ mouseDown = false; }); canvas.addEventListener("mouseout", function(evt){ mouseDown = false; }); canvas.addEventListener("mousemove", function(evt){ if (mouseDown) { translatePos.x = evt.clientX - startDragOffset.x; translatePos.y = evt.clientY - startDragOffset.y; draw(scale, translatePos); } }); draw(scale, translatePos); }; </script> Any help would be greatly appreciated
0
11,551,037
07/18/2012 22:02:19
278,785
02/22/2010 15:14:38
528
35
Replacing Binary function in a Shared Object with a custom One (Under MIPSEL)
I'm trying to break inside a device of mine which has a MIPSEL core (Little endian MIPS). I mainly want to do that because the software that came on it is kinda broken and doesn't works as intended (and the manufacturer won't help me out because i don't buy thousands of units monthly). This device has a telnet console and i have already a firmware upgrade which modifies a Shared Object (a .so file) which has relocatable code. There's one function i know is called on that .so when i access a certain feature of this device and i've already done a binary to modify /etc/passwd so i can telnet in (this can be done after i manually flash my custom firmware myself). I've already "objdump" both files and have the dissasembly of both. My question is: How can i replace a given function from the original library with my custom one so i can run my code on the box? I know objcopy can work, but its kinda difficult to get documentation on it to achieve this. What i want to do is kind like a virus, although i don't want to distribute it nor break into other's peoples devices (btw, this device i'm talking about is VERY rare).
mips
hacking
embedded-linux
shared-objects
objdump
null
open
Replacing Binary function in a Shared Object with a custom One (Under MIPSEL) === I'm trying to break inside a device of mine which has a MIPSEL core (Little endian MIPS). I mainly want to do that because the software that came on it is kinda broken and doesn't works as intended (and the manufacturer won't help me out because i don't buy thousands of units monthly). This device has a telnet console and i have already a firmware upgrade which modifies a Shared Object (a .so file) which has relocatable code. There's one function i know is called on that .so when i access a certain feature of this device and i've already done a binary to modify /etc/passwd so i can telnet in (this can be done after i manually flash my custom firmware myself). I've already "objdump" both files and have the dissasembly of both. My question is: How can i replace a given function from the original library with my custom one so i can run my code on the box? I know objcopy can work, but its kinda difficult to get documentation on it to achieve this. What i want to do is kind like a virus, although i don't want to distribute it nor break into other's peoples devices (btw, this device i'm talking about is VERY rare).
0
11,651,273
07/25/2012 13:50:30
849,843
07/18/2011 10:34:57
480
9
Google PDF Viewer not able to access restricted areas
The site that I am building requires a user to be logged in at all times, or they'll be redirected to the Login area. I am having a bit of difficulty in that I have an AssetsController which serves out files and images, but this has a `ActionFilterAttribute` on it that redirects users to login if they aren't. This is all fine and desired except that I am using Google PDF viewer to render pdf files embedded within an iframe. With the role on, it returns the page source as a the pdf unless I remove the ActionFilterAttribute. Obviously, this isn't desired as I don't want people to access all of the files on the server without permission. However, Google isn't logged in to my site so I'm wondering how I can remedy this problem. If you need any code to clarify the answer, please just ask.
c#
asp.net-mvc-3
pdf-generation
actionfilterattribute
null
null
open
Google PDF Viewer not able to access restricted areas === The site that I am building requires a user to be logged in at all times, or they'll be redirected to the Login area. I am having a bit of difficulty in that I have an AssetsController which serves out files and images, but this has a `ActionFilterAttribute` on it that redirects users to login if they aren't. This is all fine and desired except that I am using Google PDF viewer to render pdf files embedded within an iframe. With the role on, it returns the page source as a the pdf unless I remove the ActionFilterAttribute. Obviously, this isn't desired as I don't want people to access all of the files on the server without permission. However, Google isn't logged in to my site so I'm wondering how I can remedy this problem. If you need any code to clarify the answer, please just ask.
0
11,539,428
07/18/2012 10:36:38
1,534,469
07/18/2012 10:34:17
1
0
Parsing a byte file in pascal
All i need to do is parse a single bye file to read the contents to the screen but i dont know how to parse could someone please give me some rough coding i could enter file addresses in or any idea on how to parse?
parsing
pascal
null
null
null
null
open
Parsing a byte file in pascal === All i need to do is parse a single bye file to read the contents to the screen but i dont know how to parse could someone please give me some rough coding i could enter file addresses in or any idea on how to parse?
0
11,542,704
07/18/2012 13:36:32
1,425,111
05/30/2012 03:37:18
1
0
Magento "Tell a Friend " redirects to 404 page inside tab
I have showed "Tell a Friend " form in tabs on product detail page using the code below <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" > <action method="addTab" translate="title" module="catalog"> <alias>send-friend</alias> <title>Send Friends</title> <block>sendfriend/send</block> <template>sendfriend/send.phtml</template> </action> </block> And I have enabled allow guest to "Yes" from backend . But on submitting the form it redirects to 404 page. The default way of sending email works fine outside the tab but inside tab it doesnot work. Am I missing something ?
friend
tell
null
null
null
null
open
Magento "Tell a Friend " redirects to 404 page inside tab === I have showed "Tell a Friend " form in tabs on product detail page using the code below <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" > <action method="addTab" translate="title" module="catalog"> <alias>send-friend</alias> <title>Send Friends</title> <block>sendfriend/send</block> <template>sendfriend/send.phtml</template> </action> </block> And I have enabled allow guest to "Yes" from backend . But on submitting the form it redirects to 404 page. The default way of sending email works fine outside the tab but inside tab it doesnot work. Am I missing something ?
0
11,542,736
07/18/2012 13:37:54
369,572
06/07/2010 04:55:50
157
9
JXTable and Header Cell Above Scrollbar
JTable and JXTables have a header cell that is generated above the scrollbar. It's a small cell but I would like to use it to render and icon and popup menu. How might I access this header cell? Thanks
swing
jtable
jxtable
null
null
null
open
JXTable and Header Cell Above Scrollbar === JTable and JXTables have a header cell that is generated above the scrollbar. It's a small cell but I would like to use it to render and icon and popup menu. How might I access this header cell? Thanks
0
11,542,737
07/18/2012 13:37:54
1,243,068
03/01/2012 15:41:56
24
0
SOAP and PHP dont work | Uncaught SoapFault exception: [HTTP] Error Fetching http headers
Have this code: set_time_limit(100); ini_set('user_agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1'); ini_set('default_socket_timeout', 100); ini_set('soap.wsdl_cache_enabled', 0); echo '<plaintext style="font-size:20px;">'; $client = new SoapClient('http://www.test/?wsdl', array( 'soap_version' => SOAP_1_2, 'cache_wsdl' => WSDL_CACHE_NONE, 'use' => SOAP_LITERAL, 'style' => SOAP_DOCUMENT, 'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1', 'connection_timeout' => 120 )); // $result = $client->ValidaRut(array( $result = $client->__call('ValidaRut', array( 'rut' => 11111111, 'dv' => '1', 'cup' => '1', 'ipserver' => gethostbyname($_SERVER['SERVER_NAME']) , 'ipcliente' => $_SERVER['REMOTE_ADDR'] )); But dont work, php say: Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http headers in /home/.../test.php:1 what happens? sorry my english. Dump of data: print_r($client->__getFunctions()); Array ( [0] => ValidaRutResponse ValidaRut(ValidaRut $parameters) ) print_r($client->__getTypes()); Array ( [0] => struct ValidaRut { double rut; string dv; string cup; string ipserver; string ipcliente; } [1] => struct ValidaRutResponse { boolean ValidaRutResult; } [2] => int char [3] => duration duration [4] => string guid ) Safe mode is off. I use WHM/cPanel, library is installed. Thanks.
php
soap
error-message
null
null
null
open
SOAP and PHP dont work | Uncaught SoapFault exception: [HTTP] Error Fetching http headers === Have this code: set_time_limit(100); ini_set('user_agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1'); ini_set('default_socket_timeout', 100); ini_set('soap.wsdl_cache_enabled', 0); echo '<plaintext style="font-size:20px;">'; $client = new SoapClient('http://www.test/?wsdl', array( 'soap_version' => SOAP_1_2, 'cache_wsdl' => WSDL_CACHE_NONE, 'use' => SOAP_LITERAL, 'style' => SOAP_DOCUMENT, 'user_agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1', 'connection_timeout' => 120 )); // $result = $client->ValidaRut(array( $result = $client->__call('ValidaRut', array( 'rut' => 11111111, 'dv' => '1', 'cup' => '1', 'ipserver' => gethostbyname($_SERVER['SERVER_NAME']) , 'ipcliente' => $_SERVER['REMOTE_ADDR'] )); But dont work, php say: Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http headers in /home/.../test.php:1 what happens? sorry my english. Dump of data: print_r($client->__getFunctions()); Array ( [0] => ValidaRutResponse ValidaRut(ValidaRut $parameters) ) print_r($client->__getTypes()); Array ( [0] => struct ValidaRut { double rut; string dv; string cup; string ipserver; string ipcliente; } [1] => struct ValidaRutResponse { boolean ValidaRutResult; } [2] => int char [3] => duration duration [4] => string guid ) Safe mode is off. I use WHM/cPanel, library is installed. Thanks.
0
11,542,738
07/18/2012 13:37:57
1,506,145
07/06/2012 08:15:36
42
0
Zooming a JLabel by overriding paintComponent ()
## Consider this small runnable example: ## import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.util.ArrayList; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; public class Test2 extends JFrame implements MouseWheelListener{ ArrayList<JLabel> lista = new ArrayList<JLabel>(); JPanel p; double d = 0.1; Test2(){ p=new JPanel(); _JLabel j = new _JLabel("Hello"); j.setOpaque(true); j.setBackground(Color.yellow); p.add(j); p.setBackground(Color.blue); add(p); this.setVisible(true); this.setSize(400,400); addMouseWheelListener(this); setDefaultCloseOperation(EXIT_ON_CLOSE); } public static void main(String args[]){ new Test2(); } private class _JLabel extends JLabel{ _JLabel(String s){ super(s); } protected void paintComponent(Graphics g) { d+=0.01; Graphics2D g2d = (Graphics2D) g; g2d.scale(d, d); setMaximumSize(null); setPreferredSize(null); setMinimumSize(null); super.paintComponent(g2d); System.out.println("d= " +d); } } public void mouseWheelMoved(MouseWheelEvent e) { this.repaint(); } } When I scroll the mousewheel the JLabel increases in size and the variable d is printed out. However, when it reaches the actual size (d=1) **only the text continues zooming**. How can I make the background continue to zoom?
java
swing
zoom
jlabel
paintcomponent
null
open
Zooming a JLabel by overriding paintComponent () === ## Consider this small runnable example: ## import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.util.ArrayList; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; public class Test2 extends JFrame implements MouseWheelListener{ ArrayList<JLabel> lista = new ArrayList<JLabel>(); JPanel p; double d = 0.1; Test2(){ p=new JPanel(); _JLabel j = new _JLabel("Hello"); j.setOpaque(true); j.setBackground(Color.yellow); p.add(j); p.setBackground(Color.blue); add(p); this.setVisible(true); this.setSize(400,400); addMouseWheelListener(this); setDefaultCloseOperation(EXIT_ON_CLOSE); } public static void main(String args[]){ new Test2(); } private class _JLabel extends JLabel{ _JLabel(String s){ super(s); } protected void paintComponent(Graphics g) { d+=0.01; Graphics2D g2d = (Graphics2D) g; g2d.scale(d, d); setMaximumSize(null); setPreferredSize(null); setMinimumSize(null); super.paintComponent(g2d); System.out.println("d= " +d); } } public void mouseWheelMoved(MouseWheelEvent e) { this.repaint(); } } When I scroll the mousewheel the JLabel increases in size and the variable d is printed out. However, when it reaches the actual size (d=1) **only the text continues zooming**. How can I make the background continue to zoom?
0
11,542,739
07/18/2012 13:38:13
277,603
02/20/2010 10:57:14
1,753
10
django file upload from json
Hi i have given the complete code for my file upload .But in my views i am just trying to return a response and get the alert on the UI.But none of the return statements are working.How to rectify this.. `EDIT` : i see the logging statements on the server side <h1>Add Content</h1> <form method="post" enctype="multipart/form-data" id="contentform" action="/content/savecontent/" >{% csrf_token %} <b> <table> <tr><td><font>*</font>Content Name</td><td> <input type="text" id="cname" name="cname" maxlength="30"/></td></tr> <tr><td><font>*</font>Description</td><td><input type="text" id="cdescription" name="cdescription" maxlength="30"/> </td></tr> <tr><td><font>*</font>Type</td><td> <select id="type" name="type"> <option value="1" selected>Local</option> <option value="2">Internet</option> </select> </td></tr> <tr><td><font>*</font>Access</td><td> <select id="access" name="access"> <option value="1" selected>Public</option> <option value="2">Private</option> </select> </td></tr> <tr><td><font>*</font>Content</td><td id="carea"> </td></tr> <tr><td></td><td><input type="button" value="Upload" id="addbtn" onclick="ajax_upload('#contentform');"/></td></tr> </table> </b> </form> <script> $(document).ready(function() { $('font').css({'color':'red'}) $("#carea").html('').append('{{form.file_upload}}'); }); function ajax_upload(formid) { var form = $(formid); form.ajaxSubmit({ dataType: 'json', success: function (data) { alert("hereeeeeee"); } } ) ; } </script> views.py def savecontent(request): response_dict={'status':1} logging.debug(request) logging.debug("========================================") return render_to_response('content/confirmation.html', context_instance=RequestContext(request, {'response_dict':response_dict})) #return HttpResponse(simplejson.dumps(response_dict), mimetype='application/javascript') #return HttpResponse(simplejson.dumps(response_dict), mimetype='text/html') #return HttpResponse(simplejson.dumps(response_dict), mimetype='application/json')
ajax
django
json
django-views
response
null
open
django file upload from json === Hi i have given the complete code for my file upload .But in my views i am just trying to return a response and get the alert on the UI.But none of the return statements are working.How to rectify this.. `EDIT` : i see the logging statements on the server side <h1>Add Content</h1> <form method="post" enctype="multipart/form-data" id="contentform" action="/content/savecontent/" >{% csrf_token %} <b> <table> <tr><td><font>*</font>Content Name</td><td> <input type="text" id="cname" name="cname" maxlength="30"/></td></tr> <tr><td><font>*</font>Description</td><td><input type="text" id="cdescription" name="cdescription" maxlength="30"/> </td></tr> <tr><td><font>*</font>Type</td><td> <select id="type" name="type"> <option value="1" selected>Local</option> <option value="2">Internet</option> </select> </td></tr> <tr><td><font>*</font>Access</td><td> <select id="access" name="access"> <option value="1" selected>Public</option> <option value="2">Private</option> </select> </td></tr> <tr><td><font>*</font>Content</td><td id="carea"> </td></tr> <tr><td></td><td><input type="button" value="Upload" id="addbtn" onclick="ajax_upload('#contentform');"/></td></tr> </table> </b> </form> <script> $(document).ready(function() { $('font').css({'color':'red'}) $("#carea").html('').append('{{form.file_upload}}'); }); function ajax_upload(formid) { var form = $(formid); form.ajaxSubmit({ dataType: 'json', success: function (data) { alert("hereeeeeee"); } } ) ; } </script> views.py def savecontent(request): response_dict={'status':1} logging.debug(request) logging.debug("========================================") return render_to_response('content/confirmation.html', context_instance=RequestContext(request, {'response_dict':response_dict})) #return HttpResponse(simplejson.dumps(response_dict), mimetype='application/javascript') #return HttpResponse(simplejson.dumps(response_dict), mimetype='text/html') #return HttpResponse(simplejson.dumps(response_dict), mimetype='application/json')
0
11,542,740
07/18/2012 13:38:17
1,531,730
07/17/2012 12:12:30
18
0
How to check if Directory is Accessable without catching System.UnauthorizedAccessException
I have searched and searched through the net but couldn't find a good solution for this problem. Here my code: protected bool isFileValid(FileSystemInfo ifo) { if (!ifo.Exists || ifo.Name.StartsWith("$") || ifo.Name.Equals("System Volume Information")) return false; if(ifo is DirectoryInfo){ try { ((DirectoryInfo)ifo).GetFileSystemInfos(); } catch (Exception e) { LogUtil.Debug("Exception in isFileValid" + e.Message); return false; } } return true; } Is there any way to check if i can access the Directory other than to try catch the Exception? The problem with this approche is that it gets realy slow if there are many directories i can not access. What i mean by "access the Directory" is the call of `GetFileSystemInfos()` without exception. `isFileValid` is called by my application for every `FileSystemInfo` to determine if it is accessible in the way i described. Thanks in advance for any ideas how to solve this.
.net
directory
access-violation
null
null
null
open
How to check if Directory is Accessable without catching System.UnauthorizedAccessException === I have searched and searched through the net but couldn't find a good solution for this problem. Here my code: protected bool isFileValid(FileSystemInfo ifo) { if (!ifo.Exists || ifo.Name.StartsWith("$") || ifo.Name.Equals("System Volume Information")) return false; if(ifo is DirectoryInfo){ try { ((DirectoryInfo)ifo).GetFileSystemInfos(); } catch (Exception e) { LogUtil.Debug("Exception in isFileValid" + e.Message); return false; } } return true; } Is there any way to check if i can access the Directory other than to try catch the Exception? The problem with this approche is that it gets realy slow if there are many directories i can not access. What i mean by "access the Directory" is the call of `GetFileSystemInfos()` without exception. `isFileValid` is called by my application for every `FileSystemInfo` to determine if it is accessible in the way i described. Thanks in advance for any ideas how to solve this.
0
11,542,743
07/18/2012 13:38:20
1,530,911
07/17/2012 07:03:58
1
0
About view creation in stored procedure
create procedure pro_training2 as begin create view Tab1view As select * from tab1 end Is this possible to create a view in the procure..?
c#
mysql
sql
sql-server
sql-server-2008
null
open
About view creation in stored procedure === create procedure pro_training2 as begin create view Tab1view As select * from tab1 end Is this possible to create a view in the procure..?
0
11,542,744
07/18/2012 13:38:23
1,534,875
07/18/2012 13:11:25
1
0
Using Built-in "Follow" action linkin to my website user profile
Since customized "follow" action isnt accepted anymore i need to use the built-in follow ! My problem is here : When i'm posting on the graph "XXX followed USER" the link is going on the facebook profile of the user. I want the link going to : http://www.mywebsite.com/user-profile/ Here are my metatags : Meta Tag : <meta property="og:type" content="profile" /> Meta Tag : <meta property="og:url" content="http://www.mywebsite.com/user-profile/" /> Meta Tag : <meta property="og:title" content="USER" /> Meta Tag : <meta property="og:description" content="USER" /> Meta Tag : <meta property="fb:profile_id" content="XXXXXXXXX" /> Here is my request with JS SDK : https://graph.facebook.com/me/og.follows?profile=http://www.mywebsite.com/user-profile/&method=post&access_token=xxxxxxxxxx I dont know if can (and how to ?) associate a customized type (like user instead of built-in profile) on the built-in follow action ? Thanks for advance.
facebook
url
built-in
null
null
null
open
Using Built-in "Follow" action linkin to my website user profile === Since customized "follow" action isnt accepted anymore i need to use the built-in follow ! My problem is here : When i'm posting on the graph "XXX followed USER" the link is going on the facebook profile of the user. I want the link going to : http://www.mywebsite.com/user-profile/ Here are my metatags : Meta Tag : <meta property="og:type" content="profile" /> Meta Tag : <meta property="og:url" content="http://www.mywebsite.com/user-profile/" /> Meta Tag : <meta property="og:title" content="USER" /> Meta Tag : <meta property="og:description" content="USER" /> Meta Tag : <meta property="fb:profile_id" content="XXXXXXXXX" /> Here is my request with JS SDK : https://graph.facebook.com/me/og.follows?profile=http://www.mywebsite.com/user-profile/&method=post&access_token=xxxxxxxxxx I dont know if can (and how to ?) associate a customized type (like user instead of built-in profile) on the built-in follow action ? Thanks for advance.
0
11,542,745
07/18/2012 13:38:27
1,420,583
05/27/2012 20:35:11
1
0
Reading integers from keyboard in Assembly (Linux IA-32 x86 gcc gas)
I'd like to know how to read integers from keyboard in assembly. I'm using Linux/x86 IA-32 architecture and GCC/GAS (GNU Assembler). The examples I found so far are for NASM or some other Windows/DOS related compiler. I heard that it has something to do with the "int 16h" interrupt, but I don't know how it works (does it needs parameters? The result goes to %eax or any of its virtual registers [AX, AH, AL]?). Thanks in advance, Flayshon. :D
linux
gcc
assembly
interrupt
gas
null
open
Reading integers from keyboard in Assembly (Linux IA-32 x86 gcc gas) === I'd like to know how to read integers from keyboard in assembly. I'm using Linux/x86 IA-32 architecture and GCC/GAS (GNU Assembler). The examples I found so far are for NASM or some other Windows/DOS related compiler. I heard that it has something to do with the "int 16h" interrupt, but I don't know how it works (does it needs parameters? The result goes to %eax or any of its virtual registers [AX, AH, AL]?). Thanks in advance, Flayshon. :D
0
11,542,750
07/18/2012 13:38:51
976,050
10/03/2011 04:13:20
176
0
Validation values
I'm trying to validate my values for alphabets and numberic as well as checking from database. I have created a function of validation and declaring my onclick button with validation function. Function: <script> function validate() { var StudentID= document.getElementById('StudentID').value; var StudentName = document.getElementById('StudentName').value; var StudentAdd = document.getElementById('StudentAdd').value; if(StudentID.length ==0 || StudentName.length ==0) { alert("Please do not leave any blanks"); return false; } else { if(isNumeric(StudentID)) { alert("correct") } else { alert("Numbers only!"); return false;} alert("Correct correct"); } return true; } </script> Sample Form: <form id="Student" name="Student" method="post" action="nextpage.php"> <input name="StudentID" type="text" id="StudentID" value="<?php echo $StudentID?>"/> <input name="StudentName" type="text" id="StudentName" value="<?php echo $StudentName?>"/> <input name="StudentAdd" type="text" id="StudentAdd" value="<?php echo $StudentAdd?>"/> <input type="submit" name="submit" value="Submit" onclick="return validate();"/> </form> I have already declared return validate function instead of calling my nextpage.php. But nothing popup for any alert. Kindly advise. Thanks
php
javascript
html
null
null
null
open
Validation values === I'm trying to validate my values for alphabets and numberic as well as checking from database. I have created a function of validation and declaring my onclick button with validation function. Function: <script> function validate() { var StudentID= document.getElementById('StudentID').value; var StudentName = document.getElementById('StudentName').value; var StudentAdd = document.getElementById('StudentAdd').value; if(StudentID.length ==0 || StudentName.length ==0) { alert("Please do not leave any blanks"); return false; } else { if(isNumeric(StudentID)) { alert("correct") } else { alert("Numbers only!"); return false;} alert("Correct correct"); } return true; } </script> Sample Form: <form id="Student" name="Student" method="post" action="nextpage.php"> <input name="StudentID" type="text" id="StudentID" value="<?php echo $StudentID?>"/> <input name="StudentName" type="text" id="StudentName" value="<?php echo $StudentName?>"/> <input name="StudentAdd" type="text" id="StudentAdd" value="<?php echo $StudentAdd?>"/> <input type="submit" name="submit" value="Submit" onclick="return validate();"/> </form> I have already declared return validate function instead of calling my nextpage.php. But nothing popup for any alert. Kindly advise. Thanks
0
11,500,134
07/16/2012 07:51:43
1,389,106
05/11/2012 09:35:45
305
2
How to bind an event on two html elements
I have created a dropdown menu. This menu opens by pointing on a parent div. I want to hide this div when user leaves both, the parent div or dropdown menu $(function(){ $('.a').live('mouseenter',function(){ $('#dropdown').stop(false, true).hide(); var id = $(this).attr('id'); $('#dropdown').css({ position:'absolute', top: $(this).offset().top + $(this).height() + 'px', right: '115px', left: $(this).offset().left + 'px', zIndex:1000, width:'100px' }); $('#dropdown').stop().slideDown(500); if($('#dropdown').mouseleave() && $('#'+id).mouseleave()){ $('#dropdown').slideUp(500); } }); }); ​ **[Live Demo][1]** [1]: http://jsfiddle.net/ranasaani/ThzuL/1/
jquery
html
events
javascript-events
null
null
open
How to bind an event on two html elements === I have created a dropdown menu. This menu opens by pointing on a parent div. I want to hide this div when user leaves both, the parent div or dropdown menu $(function(){ $('.a').live('mouseenter',function(){ $('#dropdown').stop(false, true).hide(); var id = $(this).attr('id'); $('#dropdown').css({ position:'absolute', top: $(this).offset().top + $(this).height() + 'px', right: '115px', left: $(this).offset().left + 'px', zIndex:1000, width:'100px' }); $('#dropdown').stop().slideDown(500); if($('#dropdown').mouseleave() && $('#'+id).mouseleave()){ $('#dropdown').slideUp(500); } }); }); ​ **[Live Demo][1]** [1]: http://jsfiddle.net/ranasaani/ThzuL/1/
0
11,500,183
07/16/2012 07:56:00
1,303,565
03/30/2012 15:07:53
1
0
How to identify the name of the branch when receiving a push from local repository in GIT?
I want to identify the name of the branch with the incoming push each time it is received from local repo. I am planning to use the branch name in a update hook. Pls let me know how to deal with this.
git
githooks
null
null
null
null
open
How to identify the name of the branch when receiving a push from local repository in GIT? === I want to identify the name of the branch with the incoming push each time it is received from local repo. I am planning to use the branch name in a update hook. Pls let me know how to deal with this.
0
11,500,194
07/16/2012 07:57:19
457,237
09/24/2010 11:53:36
6,449
238
Match functions and function calls in C using regex
I am fairly new into regexes, so I wrote the following simple regex using positive lookahead that detects functions and function calls in a C source file- \w+(?=\s*\() It works fine, but the problem is it detects non-function syntaxes like `if()`, `while()`etc too. I can easily avoid this by saying- (if(?!\()) | (while(?!\()) But the problem is how to combine the second regex with the first one? I cant `OR` them, cos the first one still matches `if()`, `while()` etc and in an `OR` expression, its enough if one of the term matches. How to combine these regexes or have a better simpler one which will not match non-function syntaxes like `if()`, `while()`
c
regex
syntax-highlighting
null
null
null
open
Match functions and function calls in C using regex === I am fairly new into regexes, so I wrote the following simple regex using positive lookahead that detects functions and function calls in a C source file- \w+(?=\s*\() It works fine, but the problem is it detects non-function syntaxes like `if()`, `while()`etc too. I can easily avoid this by saying- (if(?!\()) | (while(?!\()) But the problem is how to combine the second regex with the first one? I cant `OR` them, cos the first one still matches `if()`, `while()` etc and in an `OR` expression, its enough if one of the term matches. How to combine these regexes or have a better simpler one which will not match non-function syntaxes like `if()`, `while()`
0
11,500,195
07/16/2012 07:57:39
1,517,850
07/11/2012 13:01:10
1
0
How to post on my and user wall during absence of user in facebook api?
I would like to post on my wall and walls of users from my API for example one time a week. How to do it ?
php
facebook
facebook-graph-api
null
null
07/16/2012 13:14:09
not a real question
How to post on my and user wall during absence of user in facebook api? === I would like to post on my wall and walls of users from my API for example one time a week. How to do it ?
1
11,500,198
07/16/2012 07:57:49
829,194
07/05/2011 07:31:28
618
47
Want to update table row in asp .net mvc 3
I have 2 columns in my table named `CreatedOn` and `ModifiedOn`. Of course, In the form I dont want to show these two fields even as in hidden filed. When I post the same form I want to change `ModifiedOn` by Current DateTime and Want to keep `CreatedOn` value as it is. But as I have no hidden filed name CreatedOn, it sets it to null in the database. So I then I used the code below public ActionResult Edit(User user) { if (ModelState.IsValid) { var OldInsObj = db.Users.Find(user.UserId); DateTime UsersDateCreated = (DateTime)db.Entry(OldInsObj).Property("UsersDateCreated").CurrentValue; user.UsersDateCreated = UsersDateCreated; user.UsersDateModified = DateTime.Now; db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } } I am getting this error An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key. How can I solve this? Please don't give any blog link to read, I have already read some of them but could not. Thank you.
asp.net-mvc-3
null
null
null
null
null
open
Want to update table row in asp .net mvc 3 === I have 2 columns in my table named `CreatedOn` and `ModifiedOn`. Of course, In the form I dont want to show these two fields even as in hidden filed. When I post the same form I want to change `ModifiedOn` by Current DateTime and Want to keep `CreatedOn` value as it is. But as I have no hidden filed name CreatedOn, it sets it to null in the database. So I then I used the code below public ActionResult Edit(User user) { if (ModelState.IsValid) { var OldInsObj = db.Users.Find(user.UserId); DateTime UsersDateCreated = (DateTime)db.Entry(OldInsObj).Property("UsersDateCreated").CurrentValue; user.UsersDateCreated = UsersDateCreated; user.UsersDateModified = DateTime.Now; db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } } I am getting this error An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key. How can I solve this? Please don't give any blog link to read, I have already read some of them but could not. Thank you.
0
11,500,199
07/16/2012 07:57:52
1,190,518
02/05/2012 11:16:29
44
3
Change enum type value
Hello I am using a library. It has some options embedded in enum, but i can't figure out how to configure them. The library is called [PPRevealSideViewController][1]. It has a property: @property (nonatomic, assign) PPRevealSideOptions options; Here is the enum code: enum { PPRevealSideOptionsNone = 0, PPRevealSideOptionsShowShadows = 2 << 1, /// Disable or enable the shadows. Enabled by default PPRevealSideOptionsBounceAnimations = 1 << 2, /// Decide if the animations are boucing or not. By default, they are PPRevealSideOptionsCloseCompletlyBeforeOpeningNewDirection = 1 << 3, /// Decide if we close completely the old direction, for the new one or not. Set to YES by default PPRevealSideOptionsKeepOffsetOnRotation = 1 << 4, /// Keep the same offset when rotating. By default, set to no PPRevealSideOptionsResizeSideView = 1 << 5, /// Resize the side view. If set to yes, this disabled the bouncing stuff since the view behind is not large enough to show bouncing correctly. Set to NO by default }; typedef NSUInteger PPRevealSideOptions; Thank you very much! [1]: https://github.com/ipup/PPRevealSideViewController/ "PPRevealSideViewController"
iphone
objective-c
ios
xcode
null
null
open
Change enum type value === Hello I am using a library. It has some options embedded in enum, but i can't figure out how to configure them. The library is called [PPRevealSideViewController][1]. It has a property: @property (nonatomic, assign) PPRevealSideOptions options; Here is the enum code: enum { PPRevealSideOptionsNone = 0, PPRevealSideOptionsShowShadows = 2 << 1, /// Disable or enable the shadows. Enabled by default PPRevealSideOptionsBounceAnimations = 1 << 2, /// Decide if the animations are boucing or not. By default, they are PPRevealSideOptionsCloseCompletlyBeforeOpeningNewDirection = 1 << 3, /// Decide if we close completely the old direction, for the new one or not. Set to YES by default PPRevealSideOptionsKeepOffsetOnRotation = 1 << 4, /// Keep the same offset when rotating. By default, set to no PPRevealSideOptionsResizeSideView = 1 << 5, /// Resize the side view. If set to yes, this disabled the bouncing stuff since the view behind is not large enough to show bouncing correctly. Set to NO by default }; typedef NSUInteger PPRevealSideOptions; Thank you very much! [1]: https://github.com/ipup/PPRevealSideViewController/ "PPRevealSideViewController"
0
11,500,192
07/16/2012 07:57:07
1,030,976
11/05/2011 10:38:38
19
0
htaccess allow country domain
I would like to block all countries except mine which is Brunei. The domain is .bn <Limit GET POST PUT> order deny,allow deny from all allow from .bn allow from *.bn allow from *.*.bn allow from *.*.*.bn </Limit> My Name Address: smp-85-139.simpur.net.bn so I believe the code below works: allow from *.*.*.bn But i still got forbidden access. Anything missing here?
.htaccess
domain
block
country
null
null
open
htaccess allow country domain === I would like to block all countries except mine which is Brunei. The domain is .bn <Limit GET POST PUT> order deny,allow deny from all allow from .bn allow from *.bn allow from *.*.bn allow from *.*.*.bn </Limit> My Name Address: smp-85-139.simpur.net.bn so I believe the code below works: allow from *.*.*.bn But i still got forbidden access. Anything missing here?
0
11,500,105
07/16/2012 07:49:33
1,528,160
07/16/2012 07:24:46
1
0
No moderate comment Box on Facebook-Tab
I try since 5 days to get the moderate status for a comment box on my custom facebook tab (created with woobox). But the only thing what works is the implementation of the comment box at itself. User can post under the content. But i dont get the moderate status so i can't delete or hide post. So i tried again only with the comment box code on a serval testsite. I created a tab with woobox and set on the html-part of the tab following content: > html> head> > > meta property="fb:app_id" content="my App_ID"> > meta property="fb:admins" content="my ID"> > > /head> > > script src="http://connect.facebook.net/en_US/all.js#xfbml=1"> > /script> > > body> > > div id="fb-root"></div> > > fb:comments href="added my link to the facebook_tab"> > /fb:comments> > > /body> /html> This is what facebook said to get the moderate status [here][1] so i tried the full code from there but failed. On the comment moderate tool for the app is also no post to moderate. I set me to a moderator in the settings of the app i must create do get the app_id. My user_ID i got from [here.][2] Any idea? tia! [1]: https://developers.facebook.com/blog/post/472/ [2]: http://graph.facebook.com/username
facebook
comments
box
null
null
null
open
No moderate comment Box on Facebook-Tab === I try since 5 days to get the moderate status for a comment box on my custom facebook tab (created with woobox). But the only thing what works is the implementation of the comment box at itself. User can post under the content. But i dont get the moderate status so i can't delete or hide post. So i tried again only with the comment box code on a serval testsite. I created a tab with woobox and set on the html-part of the tab following content: > html> head> > > meta property="fb:app_id" content="my App_ID"> > meta property="fb:admins" content="my ID"> > > /head> > > script src="http://connect.facebook.net/en_US/all.js#xfbml=1"> > /script> > > body> > > div id="fb-root"></div> > > fb:comments href="added my link to the facebook_tab"> > /fb:comments> > > /body> /html> This is what facebook said to get the moderate status [here][1] so i tried the full code from there but failed. On the comment moderate tool for the app is also no post to moderate. I set me to a moderator in the settings of the app i must create do get the app_id. My user_ID i got from [here.][2] Any idea? tia! [1]: https://developers.facebook.com/blog/post/472/ [2]: http://graph.facebook.com/username
0
5,749,772
04/21/2011 21:03:20
606,805
02/07/2011 17:00:48
183
23
Visual Studio 2008 - Editing the Project Solution File to Fix the project's Directory Structure
Either VS2008 or Source Safe messed up the file structure for a program I found on Source Safe. Currently the solution files are only located under Documents and Settings\mjones\MyDocuments\Visual Studio 2008\Projects\SeminarMailings\SeminarMailings\ and all the coding files are under COIN\Development\SeminarMailings\ and Documents and Settings\mjones\MyDocuments\Visual Studio 2008\Projects\SeminarMailings\SeminarMailings\Development\ Question: How would I edit the solution file in such a way that it will still load if clean up the unecessary directories by putting all the solution files under COIN and the code files under COIN\SeminarMailings and deleting the rest of the folders (duplicate data). Background: Here's the current directory structure: ![Fixing VS2010 File Structure in Solution File][1] Here are the files that I need references in the file's solution under vS2008. ![Fixing VS2010 File Structure in Solution File][2] Here's the code for the solution file: Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "SeminarMailings", "..\..\..\..\..\..\Development\SeminarMailings", "{2951C6A1-AF82-40C6-9DD8-93E35E5135F6}" ProjectSection(WebsiteProperties) = preProject SccProjectName = ""$/SeminarMailings.root/SeminarMailings", CKLAAAAA" SccAuxPath = "" SccLocalPath = "..\.." SccProvider = "MSSCCI:Microsoft Visual SourceSafe" TargetFramework = "3.5" Debug.AspNetCompiler.VirtualPath = "/SeminarMailings" Debug.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\Development\SeminarMailings\" Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\SeminarMailings\" Debug.AspNetCompiler.Updateable = "true" Debug.AspNetCompiler.ForceOverwrite = "true" Debug.AspNetCompiler.FixedNames = "false" Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.VirtualPath = "/SeminarMailings" Release.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\Development\SeminarMailings\" Release.AspNetCompiler.TargetPath = "PrecompiledWeb\SeminarMailings\" Release.AspNetCompiler.Updateable = "true" Release.AspNetCompiler.ForceOverwrite = "true" Release.AspNetCompiler.FixedNames = "false" Release.AspNetCompiler.Debug = "False" VWDPort = "4951" DefaultWebSiteLanguage = "Visual C#" EndProjectSection EndProject Global GlobalSection(SourceCodeControl) = preSolution SccNumberOfProjects = 2 SccProjectName0 = \u0022$/SeminarMailings.root/SeminarMailings\u0022,\u0020CKLAAAAA SccLocalPath0 = ..\\..\\..\\..\\..\\.. SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe SccProjectFilePathRelativizedFromConnection0 = Documents\u0020and\u0020Settings\\mjones\\My\u0020Documents\\Visual\u0020Studio\u00202008\\Projects\\SeminarMailings\\ SccWebProject1 = true SccProjectUniqueName1 = ..\\..\\..\\..\\..\\..\\Development\\SeminarMailings SccLocalPath1 = ..\\..\\..\\..\\..\\.. SccProjectFilePathRelativizedFromConnection1 = Development\\SeminarMailings\\ SccProjectEnlistmentChoice1 = 2 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2951C6A1-AF82-40C6-9DD8-93E35E5135F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2951C6A1-AF82-40C6-9DD8-93E35E5135F6}.Debug|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal Any suggestions would be welcomed! Thanks for looking! [1]: http://i.stack.imgur.com/5q0Ib.jpg [2]: http://i.stack.imgur.com/eU3y2.jpg
visual-studio-2008
visual-sourcesafe
directory-structure
null
null
null
open
Visual Studio 2008 - Editing the Project Solution File to Fix the project's Directory Structure === Either VS2008 or Source Safe messed up the file structure for a program I found on Source Safe. Currently the solution files are only located under Documents and Settings\mjones\MyDocuments\Visual Studio 2008\Projects\SeminarMailings\SeminarMailings\ and all the coding files are under COIN\Development\SeminarMailings\ and Documents and Settings\mjones\MyDocuments\Visual Studio 2008\Projects\SeminarMailings\SeminarMailings\Development\ Question: How would I edit the solution file in such a way that it will still load if clean up the unecessary directories by putting all the solution files under COIN and the code files under COIN\SeminarMailings and deleting the rest of the folders (duplicate data). Background: Here's the current directory structure: ![Fixing VS2010 File Structure in Solution File][1] Here are the files that I need references in the file's solution under vS2008. ![Fixing VS2010 File Structure in Solution File][2] Here's the code for the solution file: Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "SeminarMailings", "..\..\..\..\..\..\Development\SeminarMailings", "{2951C6A1-AF82-40C6-9DD8-93E35E5135F6}" ProjectSection(WebsiteProperties) = preProject SccProjectName = ""$/SeminarMailings.root/SeminarMailings", CKLAAAAA" SccAuxPath = "" SccLocalPath = "..\.." SccProvider = "MSSCCI:Microsoft Visual SourceSafe" TargetFramework = "3.5" Debug.AspNetCompiler.VirtualPath = "/SeminarMailings" Debug.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\Development\SeminarMailings\" Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\SeminarMailings\" Debug.AspNetCompiler.Updateable = "true" Debug.AspNetCompiler.ForceOverwrite = "true" Debug.AspNetCompiler.FixedNames = "false" Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.VirtualPath = "/SeminarMailings" Release.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\Development\SeminarMailings\" Release.AspNetCompiler.TargetPath = "PrecompiledWeb\SeminarMailings\" Release.AspNetCompiler.Updateable = "true" Release.AspNetCompiler.ForceOverwrite = "true" Release.AspNetCompiler.FixedNames = "false" Release.AspNetCompiler.Debug = "False" VWDPort = "4951" DefaultWebSiteLanguage = "Visual C#" EndProjectSection EndProject Global GlobalSection(SourceCodeControl) = preSolution SccNumberOfProjects = 2 SccProjectName0 = \u0022$/SeminarMailings.root/SeminarMailings\u0022,\u0020CKLAAAAA SccLocalPath0 = ..\\..\\..\\..\\..\\.. SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe SccProjectFilePathRelativizedFromConnection0 = Documents\u0020and\u0020Settings\\mjones\\My\u0020Documents\\Visual\u0020Studio\u00202008\\Projects\\SeminarMailings\\ SccWebProject1 = true SccProjectUniqueName1 = ..\\..\\..\\..\\..\\..\\Development\\SeminarMailings SccLocalPath1 = ..\\..\\..\\..\\..\\.. SccProjectFilePathRelativizedFromConnection1 = Development\\SeminarMailings\\ SccProjectEnlistmentChoice1 = 2 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2951C6A1-AF82-40C6-9DD8-93E35E5135F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2951C6A1-AF82-40C6-9DD8-93E35E5135F6}.Debug|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal Any suggestions would be welcomed! Thanks for looking! [1]: http://i.stack.imgur.com/5q0Ib.jpg [2]: http://i.stack.imgur.com/eU3y2.jpg
0
11,660,801
07/26/2012 00:42:30
1,110,524
12/21/2011 19:43:28
46
0
How to keep elements hidden until listbox selection in parent is made? (MVVM)
I have a view in XAML where I have a listbox, and a selection in that listbox populates an area to the side with properties from the selected instance of the ChildViewModel. I have a few buttons in the ChildView that are connected to commands in the ChildViewModel. Before I make a selection from the parent listbox, these buttons do nothing as expected. How could I keep these buttons hidden until a selection selection in the parent listbox is made, thus creating an instance of the ChildViewModel. I know how I could accomplish this if these buttons were part of the parent view by binding the visibility of these buttons to {Binding SelectedItem, ElementName=listBoxName}. However, I am having a hard time accomplishing this within the ChildView because I do not have access to (and do not want to be dependent on) the element from the parent view. Please help me accomplish this, preferably purely within the XAML code.
c#
wpf
xaml
mvvm
visibility
null
open
How to keep elements hidden until listbox selection in parent is made? (MVVM) === I have a view in XAML where I have a listbox, and a selection in that listbox populates an area to the side with properties from the selected instance of the ChildViewModel. I have a few buttons in the ChildView that are connected to commands in the ChildViewModel. Before I make a selection from the parent listbox, these buttons do nothing as expected. How could I keep these buttons hidden until a selection selection in the parent listbox is made, thus creating an instance of the ChildViewModel. I know how I could accomplish this if these buttons were part of the parent view by binding the visibility of these buttons to {Binding SelectedItem, ElementName=listBoxName}. However, I am having a hard time accomplishing this within the ChildView because I do not have access to (and do not want to be dependent on) the element from the parent view. Please help me accomplish this, preferably purely within the XAML code.
0
11,660,403
07/25/2012 23:51:45
1,493,511
06/30/2012 20:06:26
1
0
NSTimer vs CACurrentMediaTime()
So I'm amidst my first iOS game and am struggling with how to go about the best way to integrate object movement. The game relies heavily on fast moving objects and constant, fast user input changes. As such, I'm trying to have object integration and the constraint solver run as quickly and accurately as possible (to minimize user input change in between successive game loop calls). More specifically, I'm unsure of the capabilities of the NSTimer class and CACurrentMediaTime() function. It's hard to test empirically because I'm not sure which have the larger error. For example, using an NSTimer with a repeating interval of 0.008 (~2updates/screen refresh) and calling CACurrentMediaTime() on successive calls, I find the time interval between calls varies from 0.0075 - 0.009. Hard to say which is responsible for the (small) inconsistency. So for determining the time step should I be: 1. Assume NSTimer is accurate enough to use the NSTimer time interval as the game loop time step 2. Use CACurrentMediaTime() to determine the time interval between successive game loop calls. Student and new to all of this - please be nice :) Any advice is greatly appreciated. Thanks for your time.
ios
nstimer
game-engine
null
null
null
open
NSTimer vs CACurrentMediaTime() === So I'm amidst my first iOS game and am struggling with how to go about the best way to integrate object movement. The game relies heavily on fast moving objects and constant, fast user input changes. As such, I'm trying to have object integration and the constraint solver run as quickly and accurately as possible (to minimize user input change in between successive game loop calls). More specifically, I'm unsure of the capabilities of the NSTimer class and CACurrentMediaTime() function. It's hard to test empirically because I'm not sure which have the larger error. For example, using an NSTimer with a repeating interval of 0.008 (~2updates/screen refresh) and calling CACurrentMediaTime() on successive calls, I find the time interval between calls varies from 0.0075 - 0.009. Hard to say which is responsible for the (small) inconsistency. So for determining the time step should I be: 1. Assume NSTimer is accurate enough to use the NSTimer time interval as the game loop time step 2. Use CACurrentMediaTime() to determine the time interval between successive game loop calls. Student and new to all of this - please be nice :) Any advice is greatly appreciated. Thanks for your time.
0
11,660,802
07/26/2012 00:42:35
265,480
02/03/2010 17:22:13
11
1
How to check if many-to-many-to-many... exist in table
I have 5 tables, and the 5 are foreign keys in one junction table. The problem is that I need to retrieve the jnction values that are missing. For example: Table A Table B Table C Table D -------- --------- --------- ---------- 1 4 7 A 2 5 8 B JUNCTION TABLE ----------------- 1 4 7 A 1 4 7 B 1 4 8 A 1 4 8 B 1 5 7 A 1 5 7 B 1 5 8 A 1 5 8 B 2 4 7 A 2 4 7 B 2 4 8 A 2 4 8 B 2 5 7 A 2 5 7 B 2 5 8 A 2 5 8 B So if the column 1 5 8 B is missing, when I run the query it shows 1 5 8 B.. Any Ideas?
mysql
sql
query
select
null
null
open
How to check if many-to-many-to-many... exist in table === I have 5 tables, and the 5 are foreign keys in one junction table. The problem is that I need to retrieve the jnction values that are missing. For example: Table A Table B Table C Table D -------- --------- --------- ---------- 1 4 7 A 2 5 8 B JUNCTION TABLE ----------------- 1 4 7 A 1 4 7 B 1 4 8 A 1 4 8 B 1 5 7 A 1 5 7 B 1 5 8 A 1 5 8 B 2 4 7 A 2 4 7 B 2 4 8 A 2 4 8 B 2 5 7 A 2 5 7 B 2 5 8 A 2 5 8 B So if the column 1 5 8 B is missing, when I run the query it shows 1 5 8 B.. Any Ideas?
0
11,351,378
07/05/2012 19:38:31
1,489,223
06/28/2012 16:33:02
6
0
Handling relationships 0- Noob
I have a User model that extends the built in Django User model: class CustomUser(User): objects = UserManager() tasks = models.ManyToManyField(Task) I created a User in the shell using: user=CustomUser.objects.create_user('fred', '[email protected]', 'fredpass') I have another model for Tasks and as you can see CustomUser has a manytomanyfield relating it to Task. How would I add and remove tasks that have already been created to be associated with the user I have created? I am a noob.
user
relationship
manytomanyfield
null
null
null
open
Handling relationships 0- Noob === I have a User model that extends the built in Django User model: class CustomUser(User): objects = UserManager() tasks = models.ManyToManyField(Task) I created a User in the shell using: user=CustomUser.objects.create_user('fred', '[email protected]', 'fredpass') I have another model for Tasks and as you can see CustomUser has a manytomanyfield relating it to Task. How would I add and remove tasks that have already been created to be associated with the user I have created? I am a noob.
0
11,351,379
07/05/2012 19:38:34
1,496,411
07/02/2012 15:02:29
10
0
Open a Site as a Window in Google Maps
I'm not certain if this is a valid question for this particular site, but I am using the Google Maps API v.3, and I was wondering about a feature. I'm not sure if this is possible given the restrictions Google has on the HTML that it will interpret in an info-window, but I would like to be able to open a new web site in an infoWindow (or something similar to it). The application is a bit involved, but the basics are that I am trying to integrate the information from one site, which I can't actually access, with the data I display in my map. As a temporary fix, I'd like to simply open the secondary website in a window on the map and let the user sign in as normal. Does anyone know if this is possible?
google-maps-api-3
null
null
null
null
null
open
Open a Site as a Window in Google Maps === I'm not certain if this is a valid question for this particular site, but I am using the Google Maps API v.3, and I was wondering about a feature. I'm not sure if this is possible given the restrictions Google has on the HTML that it will interpret in an info-window, but I would like to be able to open a new web site in an infoWindow (or something similar to it). The application is a bit involved, but the basics are that I am trying to integrate the information from one site, which I can't actually access, with the data I display in my map. As a temporary fix, I'd like to simply open the secondary website in a window on the map and let the user sign in as normal. Does anyone know if this is possible?
0
11,351,382
07/05/2012 19:38:42
9,435
09/15/2008 18:48:18
1,496
15
Mock patching from/import statement in Python
I am trying to get mock.patch to work on the following piece of sample code: from mock import patch from collections import defaultdict with patch('collections.defaultdict'): d = defaultdict() print 'd:', d This outputs the following: d: defaultdict(None, {}) Which means that defaultdict was not patched. If I replace the from/import statement with a straight import statement it works: from mock import patch import collections with patch('collections.defaultdict'): d = collections.defaultdict() print 'd:', d Output is: d: <MagicMock name='defaultdict()' id='139953944084176'> Is there any way to patch a call using from/import? Thank you
python
python-mock
null
null
null
null
open
Mock patching from/import statement in Python === I am trying to get mock.patch to work on the following piece of sample code: from mock import patch from collections import defaultdict with patch('collections.defaultdict'): d = defaultdict() print 'd:', d This outputs the following: d: defaultdict(None, {}) Which means that defaultdict was not patched. If I replace the from/import statement with a straight import statement it works: from mock import patch import collections with patch('collections.defaultdict'): d = collections.defaultdict() print 'd:', d Output is: d: <MagicMock name='defaultdict()' id='139953944084176'> Is there any way to patch a call using from/import? Thank you
0
11,351,384
07/05/2012 19:38:49
496,854
11/04/2010 06:21:35
676
14
In Android, is there any way to retrieve the call forwarding number on GSM phones?
Since GSM phones have a separate call settings screen for call forwarding (and those settings, I believe, are stored on the SIM card), is there a way to retrieve the call forwarding info programmatically?
android
gsm
forwarding
null
null
null
open
In Android, is there any way to retrieve the call forwarding number on GSM phones? === Since GSM phones have a separate call settings screen for call forwarding (and those settings, I believe, are stored on the SIM card), is there a way to retrieve the call forwarding info programmatically?
0
11,351,385
07/05/2012 19:38:50
1,432,875
06/02/2012 20:56:24
17
0
How place a object at the top of a page using CSS?
Suppose I wanted to place a piece of text at the top of a page like this: ![bar](http://i.imgur.com/cE8bd.png) How would I do this using only CSS?
html
css
null
null
null
null
open
How place a object at the top of a page using CSS? === Suppose I wanted to place a piece of text at the top of a page like this: ![bar](http://i.imgur.com/cE8bd.png) How would I do this using only CSS?
0
11,351,392
07/05/2012 19:39:15
1,174,024
01/27/2012 17:28:36
114
30
LDAP not quite working for JBoss 5.x whereas it did with JBoss 4.x
We are trying to run an LDAP java program on Jboss 5.1 and authentication is failing. This same application works under Jboss 4.3 and from the command line via a JVM. Basically there is a cookie being populated in the code. And its not working for Jboss 5.1 ONLY. And they are using JDK 1.6.0_27. Below is the code snippet being used for LDAP. Why is the PagedResultsResponseControl getCookie NULL for JBoss 5.x only?? Anything change in that department? do { NamingEnumeration results = ctx.search("ou=people,ou=appname,dc=dept,dc=test,dc=com", "(&(objectclass=user)(CN=*))", new SearchControls()); Control[] controls = ctx.getResponseControls(); if (controls != null) { System.out.println("if (controls != null) controls.length=" + controls.length); for (int i = 0; i < controls.length; i++) { if (controls[i] instanceof PagedResultsResponseControl) { PagedResultsResponseControl prrc = (PagedResultsResponseControl)controls[i]; cookie = prrc.getCookie(); /// The cookie is returned as null when run on jboss 5.1. It returns a cookie containg details of next page to be retrieved. // This part of the code works perfectly fine with jboss 4.3 and command line. } } } else { System.out.println("No controls were sent from the server"); } // Re-activate paged results ctx.setRequestControls(new Control[]{ new PagedResultsControl(pageSize, cookie, Control.CRITICAL) }); if(cookie==null) { System.out.println("cookie is null"); } else { System.out.println("cookie.length= " + cookie.length + "cookie= " + cookie.toString()); } } while (cookie != null);
jboss
ldap
null
null
null
null
open
LDAP not quite working for JBoss 5.x whereas it did with JBoss 4.x === We are trying to run an LDAP java program on Jboss 5.1 and authentication is failing. This same application works under Jboss 4.3 and from the command line via a JVM. Basically there is a cookie being populated in the code. And its not working for Jboss 5.1 ONLY. And they are using JDK 1.6.0_27. Below is the code snippet being used for LDAP. Why is the PagedResultsResponseControl getCookie NULL for JBoss 5.x only?? Anything change in that department? do { NamingEnumeration results = ctx.search("ou=people,ou=appname,dc=dept,dc=test,dc=com", "(&(objectclass=user)(CN=*))", new SearchControls()); Control[] controls = ctx.getResponseControls(); if (controls != null) { System.out.println("if (controls != null) controls.length=" + controls.length); for (int i = 0; i < controls.length; i++) { if (controls[i] instanceof PagedResultsResponseControl) { PagedResultsResponseControl prrc = (PagedResultsResponseControl)controls[i]; cookie = prrc.getCookie(); /// The cookie is returned as null when run on jboss 5.1. It returns a cookie containg details of next page to be retrieved. // This part of the code works perfectly fine with jboss 4.3 and command line. } } } else { System.out.println("No controls were sent from the server"); } // Re-activate paged results ctx.setRequestControls(new Control[]{ new PagedResultsControl(pageSize, cookie, Control.CRITICAL) }); if(cookie==null) { System.out.println("cookie is null"); } else { System.out.println("cookie.length= " + cookie.length + "cookie= " + cookie.toString()); } } while (cookie != null);
0
11,351,394
07/05/2012 19:39:25
1,465,957
06/19/2012 09:18:53
1
1
Invalid column name '*******'
format for this query ok , when debgging i see the value for updating but only show me this message {"Invalid column name 'Mohannad' "},please help me guys UPDATE Employee SET Name =Mohannad , Age=22 , GenderID =1 , CountryID=1 , Mobile=8765 FROM Employee INNER JOIN Country ON Employee.CountryID = Country.CountryID INNER JOIN Gender ON Employee.GenderID = Gender.GenderID WHERE EmployeeID=1 ; SELECT Employee.EmployeeID, Employee.Name, Employee.Age, Employee.GenderID, Gender.GenderName, Employee.CountryID, Country.CountryName, Employee.Mobile FROM Employee INNER JOIN Country ON Employee.CountryID = Country.CountryID INNER JOIN Gender ON Employee.GenderID = Gender.GenderID
c#
asp.net
string.format
null
null
null
open
Invalid column name '*******' === format for this query ok , when debgging i see the value for updating but only show me this message {"Invalid column name 'Mohannad' "},please help me guys UPDATE Employee SET Name =Mohannad , Age=22 , GenderID =1 , CountryID=1 , Mobile=8765 FROM Employee INNER JOIN Country ON Employee.CountryID = Country.CountryID INNER JOIN Gender ON Employee.GenderID = Gender.GenderID WHERE EmployeeID=1 ; SELECT Employee.EmployeeID, Employee.Name, Employee.Age, Employee.GenderID, Gender.GenderName, Employee.CountryID, Country.CountryName, Employee.Mobile FROM Employee INNER JOIN Country ON Employee.CountryID = Country.CountryID INNER JOIN Gender ON Employee.GenderID = Gender.GenderID
0
11,351,396
07/05/2012 19:39:34
159,072
06/02/2009 18:25:22
3,236
42
Can I learn Temenos T24 Core Banking Software at home?
Temenos T24 is a banking application which is used by the bank I am currently working in. They gave me a training about T24. But, I felt the training inadequate. On the other hand they are creating pressure for not performing well with the application. Now I need to practice the application software at home. Is there any learning edition along with the manual available for download?
banking
null
null
null
null
null
open
Can I learn Temenos T24 Core Banking Software at home? === Temenos T24 is a banking application which is used by the bank I am currently working in. They gave me a training about T24. But, I felt the training inadequate. On the other hand they are creating pressure for not performing well with the application. Now I need to practice the application software at home. Is there any learning edition along with the manual available for download?
0
11,351,397
07/05/2012 19:39:41
1,504,963
07/05/2012 19:06:02
1
0
Sencha Touch 2 Navigation Bar Title
I have a Sencha touch 2 application that uses a navigation view and has a list of items. When someone clicks on an item and I dynamically change title of the navigation bar to be the item the person clicked on and also add 3 buttons to the navigation bar. However when the user clicks on an item and the screen is re-sized to be small the title is not formatted correctly. Is there an event that happens after a panel is rendered so I can call refreshTitlePosition()?
sencha
sencha-touch-2
null
null
null
null
open
Sencha Touch 2 Navigation Bar Title === I have a Sencha touch 2 application that uses a navigation view and has a list of items. When someone clicks on an item and I dynamically change title of the navigation bar to be the item the person clicked on and also add 3 buttons to the navigation bar. However when the user clicks on an item and the screen is re-sized to be small the title is not formatted correctly. Is there an event that happens after a panel is rendered so I can call refreshTitlePosition()?
0
11,351,260
07/05/2012 19:30:57
1,449,855
06/11/2012 20:34:54
8
0
CakePHP plugin models not associating when using Containable
I have a CakePHP plugin named `Foo` that has a component, no controller, and several joined models. It's structured like this: /Plugin/Foo/Model/ -FooModel1.php -FooModel2.php -FooModel3.php -FooModel4.php In order to connect with the standard (non-plugin) code, one of the plugin models is conditionally associated with a standard model called `Bar`. I don't believe this is relevant to the problem, but I want to be thorough. In `FooController` I make use of `Containable`, several layers deep: $params = array( 'conditions' => array('Bar.id' => $bar_id), 'contain' => array( 'FooModel1' => array( 'FooModel2' => array( 'FooModel3' => array('Something', 'FooModel4') ), ), ), ); So in my plugin controller I need to contain plugin models. I've tried prefixing the models with Foo (e.g. `Foo.FooModel1`) but `Containable` thinks I'm trying to get a model named Foo. In the `$hasAndBelongsToMany` array in the plugin models I've tried both `'Model1' => array()` and `'Foo.Model1' => array()`, neither of which work. How do I correctly set up this association? Side note: when I move the models out of the plugin and into the standard `/Model/` directory everything works fine. The problem seems to come from incorrect associations rather than the logic of the code itself. Thanks a lot for the help.
php
cakephp
containable
null
null
null
open
CakePHP plugin models not associating when using Containable === I have a CakePHP plugin named `Foo` that has a component, no controller, and several joined models. It's structured like this: /Plugin/Foo/Model/ -FooModel1.php -FooModel2.php -FooModel3.php -FooModel4.php In order to connect with the standard (non-plugin) code, one of the plugin models is conditionally associated with a standard model called `Bar`. I don't believe this is relevant to the problem, but I want to be thorough. In `FooController` I make use of `Containable`, several layers deep: $params = array( 'conditions' => array('Bar.id' => $bar_id), 'contain' => array( 'FooModel1' => array( 'FooModel2' => array( 'FooModel3' => array('Something', 'FooModel4') ), ), ), ); So in my plugin controller I need to contain plugin models. I've tried prefixing the models with Foo (e.g. `Foo.FooModel1`) but `Containable` thinks I'm trying to get a model named Foo. In the `$hasAndBelongsToMany` array in the plugin models I've tried both `'Model1' => array()` and `'Foo.Model1' => array()`, neither of which work. How do I correctly set up this association? Side note: when I move the models out of the plugin and into the standard `/Model/` directory everything works fine. The problem seems to come from incorrect associations rather than the logic of the code itself. Thanks a lot for the help.
0
11,351,399
07/05/2012 19:39:52
310,431
04/06/2010 21:49:48
2,537
111
Deploying static media to a server separate from the main environment
I'm having trouble with some changes to a fabric deployment script. We are switching from using a prone to breakage NFS mount for hosting our static media to using a separate webserver that will host and handle all of our static media. The goal is that regardless of environment that we're deploying (test, prod, etc) that the upload_static_content command will only run on the static media server. Right now if we run `fab test upload_static_content` everything works out perfectly. The static content ends up on the correct server in the correct directory. However, if we run `fad test deploy` the static content ends up on the test webserver rather than the intended server. def test(): ... env.hosts=testhosts def prod(): ... env.hosts=prodhosts def deploy(): # Do some deployment stuff ... upload_static_content() ... @hosts([static_server,]) @run_once def upload_static_content() # Upload static content to a different server ...
django
deployment
fabric
null
null
null
open
Deploying static media to a server separate from the main environment === I'm having trouble with some changes to a fabric deployment script. We are switching from using a prone to breakage NFS mount for hosting our static media to using a separate webserver that will host and handle all of our static media. The goal is that regardless of environment that we're deploying (test, prod, etc) that the upload_static_content command will only run on the static media server. Right now if we run `fab test upload_static_content` everything works out perfectly. The static content ends up on the correct server in the correct directory. However, if we run `fad test deploy` the static content ends up on the test webserver rather than the intended server. def test(): ... env.hosts=testhosts def prod(): ... env.hosts=prodhosts def deploy(): # Do some deployment stuff ... upload_static_content() ... @hosts([static_server,]) @run_once def upload_static_content() # Upload static content to a different server ...
0
11,351,403
07/05/2012 19:40:08
1,491,465
06/29/2012 14:52:42
1
0
JPEG2000 & UIImage
i was comparing Jpeg2000 and Jpeg display speed using UIImage (UIImageView) and noticed that displaying Jpeg2000 is pretty slow compared to Jpeg. Is this expected and are there and ways to speed it up? Thanks, -r
ios
uiimage
jpeg2000
null
null
null
open
JPEG2000 & UIImage === i was comparing Jpeg2000 and Jpeg display speed using UIImage (UIImageView) and noticed that displaying Jpeg2000 is pretty slow compared to Jpeg. Is this expected and are there and ways to speed it up? Thanks, -r
0
11,351,135
07/05/2012 19:22:38
1,174,696
01/28/2012 01:55:40
59
0
Create ul and li elements in javascript.
I am trying to create ul and li element in my codes by using javascript. I have following: var test=document.createElement('section'); test.setAttribute('id','test'); var ul=document.createElement('ul'); document.body.appendChild(test); test.appendChild(ul); for (var i=0; i<array.length; i++){ var li=document.createElement('li'); ul.appendChild(li); li.innerHTML=li.innerHTML + array[i]; } My array is parsed using json_encode from php array[0]='aaa'; array[1]='bbb'; array[2]='ccc'; CSS section { display: block; width: 200px; margin: 50px auto; border: 3px solid red; } Everything works fine except the list style dot is outside of my section tag. It displays like this in Chrome and IE but firefox work fine. ------------- *| aaa | *| bbb | *| ccc | ------------- I want my dot inside my section tag. Anyone idea? Thanks a lot.
javascript
null
null
null
null
null
open
Create ul and li elements in javascript. === I am trying to create ul and li element in my codes by using javascript. I have following: var test=document.createElement('section'); test.setAttribute('id','test'); var ul=document.createElement('ul'); document.body.appendChild(test); test.appendChild(ul); for (var i=0; i<array.length; i++){ var li=document.createElement('li'); ul.appendChild(li); li.innerHTML=li.innerHTML + array[i]; } My array is parsed using json_encode from php array[0]='aaa'; array[1]='bbb'; array[2]='ccc'; CSS section { display: block; width: 200px; margin: 50px auto; border: 3px solid red; } Everything works fine except the list style dot is outside of my section tag. It displays like this in Chrome and IE but firefox work fine. ------------- *| aaa | *| bbb | *| ccc | ------------- I want my dot inside my section tag. Anyone idea? Thanks a lot.
0
11,351,138
07/05/2012 19:23:15
123,930
06/16/2009 20:44:31
645
12
Maximum number of characters in a field of a csv file using unix shell commands?
I have a csv file. In one of the fields, say the second field, I need to know maximum number of characters in that field. For example, given the file below: adf,jlkjl,lkjlk jf,j,lkjljk jlkj,lkejflkj,adfafef, jfje,jj,lkjlkj jjee,eeee,ereq the answer would be 8 because row 3 has 8 characters in the second field. I would like to integrate this into a bash script, so common unix command line programs are preferred. Imaginary bonus points for explaining what the command is doing.
unix
command-line
csv
text-processing
null
null
open
Maximum number of characters in a field of a csv file using unix shell commands? === I have a csv file. In one of the fields, say the second field, I need to know maximum number of characters in that field. For example, given the file below: adf,jlkjl,lkjlk jf,j,lkjljk jlkj,lkejflkj,adfafef, jfje,jj,lkjlkj jjee,eeee,ereq the answer would be 8 because row 3 has 8 characters in the second field. I would like to integrate this into a bash script, so common unix command line programs are preferred. Imaginary bonus points for explaining what the command is doing.
0
11,734,841
07/31/2012 07:04:45
1,564,893
07/31/2012 06:41:04
1
0
SignalR not broadcasting to clients - (mobile browser) connected through wifi
I have been trying to broadcast message to all clients who connected to my hub, all desktop browsers (IE 9, Chrome 20.x) receives the message except mobile browsers who are connected through WiFi. I deployed application in IIS7 and using accessing it within LAN. So the server code which I have is as follows - [HubName("notifications")] public class Notifications : Hub { try { using (var context = new xxxEntities()) { // EF code that post the record to the database Clients.taskAdded(message); return true; } } catch (Exception ex) { Caller.reportError("Unable to create notification message. Make sure title length is between 10 and 140"); return false; } Client side code - //Handlers for our Hub callbacks //Invoked from our TaskHub.cs this.hub.taskAdded = function (t) { messages.push(new notificationViewModel(t.Id, t.Message, t.User, t.Notified, self)); //if (guid != test.guid) //notify all clients except the caller }; This all works well on desktop browsers, I have used knockout.js to refresh data model bounded to HTML elements (ex. list). As and when the task got added in the database all desktop browser clients got refreshed except mobile one. so you have any clue why mobile browsers doesn't get notified?
mvc
knockout.js
signalr
null
null
null
open
SignalR not broadcasting to clients - (mobile browser) connected through wifi === I have been trying to broadcast message to all clients who connected to my hub, all desktop browsers (IE 9, Chrome 20.x) receives the message except mobile browsers who are connected through WiFi. I deployed application in IIS7 and using accessing it within LAN. So the server code which I have is as follows - [HubName("notifications")] public class Notifications : Hub { try { using (var context = new xxxEntities()) { // EF code that post the record to the database Clients.taskAdded(message); return true; } } catch (Exception ex) { Caller.reportError("Unable to create notification message. Make sure title length is between 10 and 140"); return false; } Client side code - //Handlers for our Hub callbacks //Invoked from our TaskHub.cs this.hub.taskAdded = function (t) { messages.push(new notificationViewModel(t.Id, t.Message, t.User, t.Notified, self)); //if (guid != test.guid) //notify all clients except the caller }; This all works well on desktop browsers, I have used knockout.js to refresh data model bounded to HTML elements (ex. list). As and when the task got added in the database all desktop browser clients got refreshed except mobile one. so you have any clue why mobile browsers doesn't get notified?
0
11,734,848
07/31/2012 07:05:18
1,513,871
07/10/2012 06:32:28
22
0
Session Start Custom Function in ASP.Net
I am rookie to asp.net . I am developing a application in asp.net 3.5 , on that i need to start a timer ticker whenever the site is requested to open, and ends whenever the page is closed . Heard about the Global.asax file . But , is there any possibility to call the function of another class from Global.asax . Any one help me
c#
asp.net
null
null
null
null
open
Session Start Custom Function in ASP.Net === I am rookie to asp.net . I am developing a application in asp.net 3.5 , on that i need to start a timer ticker whenever the site is requested to open, and ends whenever the page is closed . Heard about the Global.asax file . But , is there any possibility to call the function of another class from Global.asax . Any one help me
0
11,733,443
07/31/2012 05:07:22
1,564,640
07/31/2012 03:58:40
1
0
Need suggestions on thesis (Android)
I'm new here Well, long story short, I'm making an Android application for my thesis but still cant decide between two topics (initially three) that I've discussed with my adviser. - Kids tracker There are two modes here; Parents mode (Register a kid, Track now) and Kids mode (will make the app to work in background if activated. Will not show any icons). My adviser also wants that the kids' phone will send an sms to the parents phone every time the kids does not stay in a place for a period of time. The locations of the kids are taken from the service provider. By doing this, the parents can still know their kids whereabouts even if there isn't any internet connection available - Lyrics reader The app will show the lyrics of the played song, taken from either the ID3V2 tag of the mp3 file or the internet. User can also save the lyrics to the tag and edit other kinds of attributes like title, artist, album, etc. The shown lyrics will also be synchronized with the played song (doesn't have to be that exact) So...which one do you guys think will be simpler? I need to finish this in two months (yes, two months for a thesis =.=) and I'm not that familiar with Android programming (only learnt the most basics back then). What will be the hard parts in the development? What kind of codes or features or whatever we call them - will I need to use? Any help will be appreciated. Thanks so much
android
tracker
id3v2
null
null
08/01/2012 02:49:02
too localized
Need suggestions on thesis (Android) === I'm new here Well, long story short, I'm making an Android application for my thesis but still cant decide between two topics (initially three) that I've discussed with my adviser. - Kids tracker There are two modes here; Parents mode (Register a kid, Track now) and Kids mode (will make the app to work in background if activated. Will not show any icons). My adviser also wants that the kids' phone will send an sms to the parents phone every time the kids does not stay in a place for a period of time. The locations of the kids are taken from the service provider. By doing this, the parents can still know their kids whereabouts even if there isn't any internet connection available - Lyrics reader The app will show the lyrics of the played song, taken from either the ID3V2 tag of the mp3 file or the internet. User can also save the lyrics to the tag and edit other kinds of attributes like title, artist, album, etc. The shown lyrics will also be synchronized with the played song (doesn't have to be that exact) So...which one do you guys think will be simpler? I need to finish this in two months (yes, two months for a thesis =.=) and I'm not that familiar with Android programming (only learnt the most basics back then). What will be the hard parts in the development? What kind of codes or features or whatever we call them - will I need to use? Any help will be appreciated. Thanks so much
3
11,734,861
07/31/2012 07:06:01
1,345,960
04/20/2012 07:54:19
889
30
Extra braces in initializing std::array of structs using an initializer list
I've got error C2078 in VC2010 when compiling the code below. struct A { int foo; double bar; }; std::array<A, 2> a1 = // error C2078: too many initializers { {0, 0.1}, {2, 3.4} }; // OK std::array<double, 2> a2 = {0.1, 2.3}; I found out that the correct syntax for `a1` is std::array<A, 2> a1 = {{ {0, 0.1}, {2, 3.4} }}; The question is: why extra braces are required for `a1` but not required for `a2`?
c++
c++11
visual-c++-2010
null
null
null
open
Extra braces in initializing std::array of structs using an initializer list === I've got error C2078 in VC2010 when compiling the code below. struct A { int foo; double bar; }; std::array<A, 2> a1 = // error C2078: too many initializers { {0, 0.1}, {2, 3.4} }; // OK std::array<double, 2> a2 = {0.1, 2.3}; I found out that the correct syntax for `a1` is std::array<A, 2> a1 = {{ {0, 0.1}, {2, 3.4} }}; The question is: why extra braces are required for `a1` but not required for `a2`?
0
11,734,862
07/31/2012 07:06:02
212,121
11/16/2009 14:43:35
1,614
82
WCF - communication between two methods
I have a WCF client, that asks for order confirmation and WCF service with two methods: 1) UpdateOrder - updates order data in database (UpdateOrder call comes from external service) 2) GetConfirmationResult - which holds return of result till order status will change from pending to something else. Question is, how to make notification from UpdateOrder to GetConfirmationResult, that order it is interested in status has changed in WCF? Update: would be best, if I could leave InstanceContextMode as Per-Call. ![enter image description here][1] [1]: http://i.stack.imgur.com/LGwfl.png
c#
.net
wcf
c#-4.0
null
null
open
WCF - communication between two methods === I have a WCF client, that asks for order confirmation and WCF service with two methods: 1) UpdateOrder - updates order data in database (UpdateOrder call comes from external service) 2) GetConfirmationResult - which holds return of result till order status will change from pending to something else. Question is, how to make notification from UpdateOrder to GetConfirmationResult, that order it is interested in status has changed in WCF? Update: would be best, if I could leave InstanceContextMode as Per-Call. ![enter image description here][1] [1]: http://i.stack.imgur.com/LGwfl.png
0
11,734,160
07/31/2012 06:11:58
1,528,077
07/16/2012 06:33:56
3
0
symfony 1.4 post-validation of two identical forms
There are two forms of the same, the first - "main", the second "all". http://habrastorage.org/storage2/a04/37a/218/a0437a21843982cbaf2180e305af1729.png If the user has put a checkbox in the first form, it should be noted in the second form is a mistake. But if you put a checkbox in the second form - not necessarily to celebrate in the first. How to make a post-validation? Sorry for my english.
symfony-1.4
symfony-forms
null
null
null
null
open
symfony 1.4 post-validation of two identical forms === There are two forms of the same, the first - "main", the second "all". http://habrastorage.org/storage2/a04/37a/218/a0437a21843982cbaf2180e305af1729.png If the user has put a checkbox in the first form, it should be noted in the second form is a mistake. But if you put a checkbox in the second form - not necessarily to celebrate in the first. How to make a post-validation? Sorry for my english.
0
11,734,403
07/31/2012 06:33:06
1,564,864
07/31/2012 06:23:42
1
0
How to change the x-axis value dynamically with respect to the Scale widget in Python
I'm writing a code in Python to plot a ECG wave form. I've a Scale widget which ranges from 1 to 51. And I want the X-axis shall be changed as per the value set in the Scale widget. This should happen dynamically. Please help me in this.. Thanks in advance.
python-2.7
null
null
null
null
null
open
How to change the x-axis value dynamically with respect to the Scale widget in Python === I'm writing a code in Python to plot a ECG wave form. I've a Scale widget which ranges from 1 to 51. And I want the X-axis shall be changed as per the value set in the Scale widget. This should happen dynamically. Please help me in this.. Thanks in advance.
0
11,628,656
07/24/2012 10:12:31
1,382,152
05/08/2012 13:11:57
1
0
MySQL REGEX a partial word in a word
i try to match a word against other words witg REGEX in mysql but i cant get it right. For example is search for the word 'foo' then it should match the following (case insensitive): foobar barfoo barfoobar foofoo football foo-bar foo_bar And not match spaces between them like: foo bar I searched the web and found some REGEX but they don't match all the above options. This is my current pattern: REGEX '[[:<:]]'.$word.'(![:space:])[[:>:]] thanx in advance :)
mysql
regex
null
null
null
null
open
MySQL REGEX a partial word in a word === i try to match a word against other words witg REGEX in mysql but i cant get it right. For example is search for the word 'foo' then it should match the following (case insensitive): foobar barfoo barfoobar foofoo football foo-bar foo_bar And not match spaces between them like: foo bar I searched the web and found some REGEX but they don't match all the above options. This is my current pattern: REGEX '[[:<:]]'.$word.'(![:space:])[[:>:]] thanx in advance :)
0
11,628,672
07/24/2012 10:13:10
1,548,310
07/24/2012 10:05:58
1
0
Black empty table cell in HTML email showing in Outlook 2003 and less
I have been reminding myself how lovely Outlook and emails are. I have got a problem when my 'empty' spacer table cells are showing up as black table cells in Outlook 2003 or less, any ideas what this could be? I have spacer gifs and I have given width and set bgcolor on the tds but it's still causing this issue. I also had this when using spans to style text however changing them to divs solved this issue. Here is a snippet of my code: <!-- Introduction section --> <table id="intro" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%" align="center" style="font-size: 15px; line-height: 24px border: none;"> <tr> <td height="16" bgcolor="#fff" colspan="3"> </td> </tr> <tr> <td colspan="3"> <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%" align="center"> <tr> <td width="60%" height="1" bgcolor="#99ad26"> </td> <td width="40%" height="1" bgcolor="#ffffff"> </td> </tr> </table> </td> </tr> <tr> <td height="2" bgcolor="#fff" colspan="3"> </td> </tr> <tr> <td colspan="3"> <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%" align="center"> <tr> <td width="70%" height="1" bgcolor="#99ad26"> </td> <td width="30%" height="1" bgcolor="#ffffff"> </td> </tr> </table> </td> </tr> <tr> <td height="24" bgcolor="#ffffff" colspan="3"> </td> </tr> <tr> <td width="24" bgcolor="#fff"><img src="http://www.ukgbc.org/sites/files/ukgbc/email/images/spacer.gif" alt="" width="24" height="1" style="display: block;"/</td> <td width="512" align="left" bgcolor="#fff"> <h1 style="font-size: 30px; margin: 0px; margin-bottom: 25px; font-family:Arial, Helvetica, sans-serif; background-color: #fff;" mc:edit="intro_heading">Introduction</h1> <div mc:edit="greeting" mc:hideable style="font-family:Arial, Helvetica, sans-serif; font-size:16px; background-color: #fff;">Dear *|FNAME|*,</div> <br /><br /> <div mc:edit="introduction" style="font-family:Arial, Helvetica, sans-serif; font-size:15px; background-color: #fff;"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi dui sem, rutrum ut tristique a, eleifend quis libero. Aenean scelerisque blandit ante quis aliquet. Proin et augue odio, eget porta tortor. Fusce pharetra quam sed nisl vulputate ullamcorper. </div> </td> <td width="24" bgcolor="#fff"><img src="http://www.ukgbc.org/sites/files/ukgbc/email/images/spacer.gif" alt="" width="24" height="1" style="display: block;"/</td> </tr> <tr> <td height="40" bgcolor="#fff" colspan="3"> </td> </tr> </table> Thanks
html
email
table
outlook
null
null
open
Black empty table cell in HTML email showing in Outlook 2003 and less === I have been reminding myself how lovely Outlook and emails are. I have got a problem when my 'empty' spacer table cells are showing up as black table cells in Outlook 2003 or less, any ideas what this could be? I have spacer gifs and I have given width and set bgcolor on the tds but it's still causing this issue. I also had this when using spans to style text however changing them to divs solved this issue. Here is a snippet of my code: <!-- Introduction section --> <table id="intro" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%" align="center" style="font-size: 15px; line-height: 24px border: none;"> <tr> <td height="16" bgcolor="#fff" colspan="3"> </td> </tr> <tr> <td colspan="3"> <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%" align="center"> <tr> <td width="60%" height="1" bgcolor="#99ad26"> </td> <td width="40%" height="1" bgcolor="#ffffff"> </td> </tr> </table> </td> </tr> <tr> <td height="2" bgcolor="#fff" colspan="3"> </td> </tr> <tr> <td colspan="3"> <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%" align="center"> <tr> <td width="70%" height="1" bgcolor="#99ad26"> </td> <td width="30%" height="1" bgcolor="#ffffff"> </td> </tr> </table> </td> </tr> <tr> <td height="24" bgcolor="#ffffff" colspan="3"> </td> </tr> <tr> <td width="24" bgcolor="#fff"><img src="http://www.ukgbc.org/sites/files/ukgbc/email/images/spacer.gif" alt="" width="24" height="1" style="display: block;"/</td> <td width="512" align="left" bgcolor="#fff"> <h1 style="font-size: 30px; margin: 0px; margin-bottom: 25px; font-family:Arial, Helvetica, sans-serif; background-color: #fff;" mc:edit="intro_heading">Introduction</h1> <div mc:edit="greeting" mc:hideable style="font-family:Arial, Helvetica, sans-serif; font-size:16px; background-color: #fff;">Dear *|FNAME|*,</div> <br /><br /> <div mc:edit="introduction" style="font-family:Arial, Helvetica, sans-serif; font-size:15px; background-color: #fff;"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi dui sem, rutrum ut tristique a, eleifend quis libero. Aenean scelerisque blandit ante quis aliquet. Proin et augue odio, eget porta tortor. Fusce pharetra quam sed nisl vulputate ullamcorper. </div> </td> <td width="24" bgcolor="#fff"><img src="http://www.ukgbc.org/sites/files/ukgbc/email/images/spacer.gif" alt="" width="24" height="1" style="display: block;"/</td> </tr> <tr> <td height="40" bgcolor="#fff" colspan="3"> </td> </tr> </table> Thanks
0
11,628,674
07/24/2012 10:13:19
593,594
01/28/2011 09:50:47
131
7
Shopify: create a smart collection for products that do NOT have a specific tag
In Shopify I have a smart collection for all the product that have the "wholesale" tag. I'd like to create also another smart collection for all the remaining products that do NOT have the "wholesale" tag. Is this possible? Is there a workaround? Maybe creating a smart collection is not the best possible option. What I really need to do is just list 6 products that do NOT have the "wholesale" tag. Is there an easy way to do this? Thanks in advance, Augusto
shopify
null
null
null
null
null
open
Shopify: create a smart collection for products that do NOT have a specific tag === In Shopify I have a smart collection for all the product that have the "wholesale" tag. I'd like to create also another smart collection for all the remaining products that do NOT have the "wholesale" tag. Is this possible? Is there a workaround? Maybe creating a smart collection is not the best possible option. What I really need to do is just list 6 products that do NOT have the "wholesale" tag. Is there an easy way to do this? Thanks in advance, Augusto
0
11,627,273
07/24/2012 08:46:39
1,384,085
05/09/2012 08:39:56
11
0
Why doesn't this transactionscope work?
Playing with transactions for the first time I thought I'd get the following code to work: static string connString = "Server=ServerName;Database=Demo;Trusted_Connection=True;"; SqlConnection connection = new SqlConnection(connString); static Random r = new Random(); static void Add() { try { Thread.Sleep(r.Next(0, 10)); var conn = new SqlConnection(connString); conn.Open(); using (var trans = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = IsolationLevel.Serializable })) { var count = (int)new SqlCommand("select balance from bank where owner like '%Jan%'", conn).ExecuteScalar(); Thread.Sleep(r.Next(0, 10)); //Console.WriteLine("count: " + count); SqlCommand cmd = new SqlCommand("update bank set balance = " + ++count + "where owner like '%Jan%'", conn); cmd.ExecuteNonQuery(); trans.Complete(); } conn.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } } static void Remove() { try { Thread.Sleep(r.Next(0, 10)); var conn = new SqlConnection(connString); conn.Open(); using (var trans = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = IsolationLevel.Serializable })) { var count = (int)new SqlCommand("select balance from bank where owner like '%Jan%'", conn).ExecuteScalar(); Thread.Sleep(r.Next(0, 10)); //Console.WriteLine("count: " + count); SqlCommand cmd = new SqlCommand("update bank set balance = " + --count + "where owner like '%Jan%'", conn); cmd.ExecuteNonQuery(); trans.Complete(); } conn.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } } static void Main(string[] args) { for (int i = 0; i < 100; i++) { Thread t = new Thread(new ThreadStart(Add)); t.Start(); } for (int i = 0; i < 100; i++) { Thread t = new Thread(new ThreadStart(Remove)); t.Start(); } Console.ReadLine(); } I assumed that at the end after 100 adds and 100 subtractions my balane would be the same as my starting point - 100, however it keeps changing up and down every time I run the script. Even with isolationlevel serializable. Could anyone tell me why? O_o
c#
sql-server
transactions
transactionscope
null
null
open
Why doesn't this transactionscope work? === Playing with transactions for the first time I thought I'd get the following code to work: static string connString = "Server=ServerName;Database=Demo;Trusted_Connection=True;"; SqlConnection connection = new SqlConnection(connString); static Random r = new Random(); static void Add() { try { Thread.Sleep(r.Next(0, 10)); var conn = new SqlConnection(connString); conn.Open(); using (var trans = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = IsolationLevel.Serializable })) { var count = (int)new SqlCommand("select balance from bank where owner like '%Jan%'", conn).ExecuteScalar(); Thread.Sleep(r.Next(0, 10)); //Console.WriteLine("count: " + count); SqlCommand cmd = new SqlCommand("update bank set balance = " + ++count + "where owner like '%Jan%'", conn); cmd.ExecuteNonQuery(); trans.Complete(); } conn.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } } static void Remove() { try { Thread.Sleep(r.Next(0, 10)); var conn = new SqlConnection(connString); conn.Open(); using (var trans = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions() { IsolationLevel = IsolationLevel.Serializable })) { var count = (int)new SqlCommand("select balance from bank where owner like '%Jan%'", conn).ExecuteScalar(); Thread.Sleep(r.Next(0, 10)); //Console.WriteLine("count: " + count); SqlCommand cmd = new SqlCommand("update bank set balance = " + --count + "where owner like '%Jan%'", conn); cmd.ExecuteNonQuery(); trans.Complete(); } conn.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } } static void Main(string[] args) { for (int i = 0; i < 100; i++) { Thread t = new Thread(new ThreadStart(Add)); t.Start(); } for (int i = 0; i < 100; i++) { Thread t = new Thread(new ThreadStart(Remove)); t.Start(); } Console.ReadLine(); } I assumed that at the end after 100 adds and 100 subtractions my balane would be the same as my starting point - 100, however it keeps changing up and down every time I run the script. Even with isolationlevel serializable. Could anyone tell me why? O_o
0
11,628,530
07/24/2012 10:04:18
1,490,320
06/29/2012 05:20:13
16
6
The Seprator line is fill parent..i want to fit to the golden border...How can i do?
![enter image description here][1] In this image the golden seprator line is not fit to the screen..i want this line to be fit to the screen...i used the fill_parent..but this gives me this kind of layout... [1]: http://i.stack.imgur.com/Bk9GS.png
android
custom-lists
null
null
null
null
open
The Seprator line is fill parent..i want to fit to the golden border...How can i do? === ![enter image description here][1] In this image the golden seprator line is not fit to the screen..i want this line to be fit to the screen...i used the fill_parent..but this gives me this kind of layout... [1]: http://i.stack.imgur.com/Bk9GS.png
0
11,628,680
07/24/2012 10:13:46
1,474,018
06/22/2012 06:30:09
8
0
Create array whose keys and values depend of other arrays
There are some topics narrowing my problem, but no one permits me to solve it.I have a csv file of terms from which i would like to count the number in a table of my db and to write the result in a new csv file. I need to create a new array, where each key would be a term of the first array and the value would be the related number of records in my database. Here are some examples of the input : Lactose Serine And i would like to get something like this: lactose, 25 serine, 3 So i have created an array whose values are the terms in the csv file. Then i input the values of this array in a sql query. And then, i have been unable to find the right way on the Internet or in the php documentation. The last line completely fails, but i tried it because it seemed to be the narrower mean to manage my task. Could someone help me ? Thanks in advance ! $termslist= array(); $file = fopen('fileterms.csv', 'r'); while (($line = fgetcsv($file)) !== FALSE) { //$line is an array of the csv elements foreach ($line AS $molindice => $molvalues) { if ( ! in_array( $molvalue, $termslist ) ) {array_push($termslist, $molvalues);} } } fclose($file); //print_r ($termslist); $molnumbers = array(); foreach ($termslist as $ancientkey => $ancientvalue) { echo $ancientvalue; $sql3 = "SELECT content from mols WHERE content like '% $ancientvalue %'"; $result3 = mysql_query($sql3)or die(mysql_error()); $count3 = mysql_num_rows($result3); echo $count3; $molnumbers [$ancientvalue['molnames']] = $count3['quantities']; }
php
arrays
null
null
null
null
open
Create array whose keys and values depend of other arrays === There are some topics narrowing my problem, but no one permits me to solve it.I have a csv file of terms from which i would like to count the number in a table of my db and to write the result in a new csv file. I need to create a new array, where each key would be a term of the first array and the value would be the related number of records in my database. Here are some examples of the input : Lactose Serine And i would like to get something like this: lactose, 25 serine, 3 So i have created an array whose values are the terms in the csv file. Then i input the values of this array in a sql query. And then, i have been unable to find the right way on the Internet or in the php documentation. The last line completely fails, but i tried it because it seemed to be the narrower mean to manage my task. Could someone help me ? Thanks in advance ! $termslist= array(); $file = fopen('fileterms.csv', 'r'); while (($line = fgetcsv($file)) !== FALSE) { //$line is an array of the csv elements foreach ($line AS $molindice => $molvalues) { if ( ! in_array( $molvalue, $termslist ) ) {array_push($termslist, $molvalues);} } } fclose($file); //print_r ($termslist); $molnumbers = array(); foreach ($termslist as $ancientkey => $ancientvalue) { echo $ancientvalue; $sql3 = "SELECT content from mols WHERE content like '% $ancientvalue %'"; $result3 = mysql_query($sql3)or die(mysql_error()); $count3 = mysql_num_rows($result3); echo $count3; $molnumbers [$ancientvalue['molnames']] = $count3['quantities']; }
0
11,411,439
07/10/2012 10:32:30
1,257,322
03/08/2012 15:19:08
6
0
Newbie: Setup .htaccess to utalise internal and external domain mapping correctly
Having a bad time trying to wrap my head around using a .htaccess file to setup my domain mapping. I have hosing package with 123-reg.co.uk and need to host two sites on one host. i have been advides what i need to do is setup a .htaccess to make the second site work, as currently it is only showing the HTML with broken images and CSS. the primary domain is www.wqbf.org.uk which only has a holiding page, so is setup with index.html and a single image in the root of the folder. This is held by 123-reg.co.uk Next is the 2nd website, www.sanreneguardships.com (Externally redirected and mapped from godaddy.com), which is setup as a site with multiple directories holding everything. The current directory setup looks like this Root - Index.html - image.png - /Sanrene - /Sanrene/HTML - /Sanrene/Images - /Sanrene/CSS - /Sanrene/Files All the files are held in respective folders, and according to 123-reg's "superb" technical help, first I need to contact a web designer and then I need to look at a 301 redirect script that does not do what I want to do. I finally got it out of them that I need to setup a .htaccess to remap the 2nd site to the correct folders Ive looked at the tutorial [Here][1] but cant get my head around it. [1]: http://www.javascriptkit.com/howto/htaccess.shtml Would anyone please be able to give me some advice on how to keep the website wqbf.org.uk AND Sanreneguardships.com on the same host? The hosting package is setup on a linux package with limited configuration Thankyou
.htaccess
dns
domain-mapping
null
null
null
open
Newbie: Setup .htaccess to utalise internal and external domain mapping correctly === Having a bad time trying to wrap my head around using a .htaccess file to setup my domain mapping. I have hosing package with 123-reg.co.uk and need to host two sites on one host. i have been advides what i need to do is setup a .htaccess to make the second site work, as currently it is only showing the HTML with broken images and CSS. the primary domain is www.wqbf.org.uk which only has a holiding page, so is setup with index.html and a single image in the root of the folder. This is held by 123-reg.co.uk Next is the 2nd website, www.sanreneguardships.com (Externally redirected and mapped from godaddy.com), which is setup as a site with multiple directories holding everything. The current directory setup looks like this Root - Index.html - image.png - /Sanrene - /Sanrene/HTML - /Sanrene/Images - /Sanrene/CSS - /Sanrene/Files All the files are held in respective folders, and according to 123-reg's "superb" technical help, first I need to contact a web designer and then I need to look at a 301 redirect script that does not do what I want to do. I finally got it out of them that I need to setup a .htaccess to remap the 2nd site to the correct folders Ive looked at the tutorial [Here][1] but cant get my head around it. [1]: http://www.javascriptkit.com/howto/htaccess.shtml Would anyone please be able to give me some advice on how to keep the website wqbf.org.uk AND Sanreneguardships.com on the same host? The hosting package is setup on a linux package with limited configuration Thankyou
0
11,411,440
07/10/2012 10:32:38
131,120
06/30/2009 14:32:56
984
30
Using Variables as Args
Think you have a variable that contains a string of text with spaces inbetween and you want to use that as input arguments for another script. How would you go about passing the variable content without worrying about the space chars? The following doesn't work: VAR1=hello\ world #... do something else ./a_script.sh $VAR1
bash
null
null
null
null
null
open
Using Variables as Args === Think you have a variable that contains a string of text with spaces inbetween and you want to use that as input arguments for another script. How would you go about passing the variable content without worrying about the space chars? The following doesn't work: VAR1=hello\ world #... do something else ./a_script.sh $VAR1
0
11,411,441
07/10/2012 10:32:42
1,298,632
03/28/2012 15:46:03
26
0
Delphi webservice call not in parallel
I developed an application that get messages through TCP server in parallel and calls a webservice from another webserver application. I noted that parallel requests processed by webservice server in serial. I forced webserver to have delay in response to enhance situation. I traced and found that webservice calls are in parallel by low level Delphi webserivce call serialize calls. I sniffed and found only one connection is opened and HTTP requests are sent one by one after getting response. My base web service call is as bellow var HTTPRIO: THTTPRIO; WS: TelephoneDispachServerSoap; begin try HTTPRIO := THTTPRIO.Create(nil); WS := GetTelephoneDispachServerSoap(false, '',HTTPRIO); CoInitialize(nil); r := WS.MaxMethod(10,20); finally CoUninitialize; end; end; What Should I do to send webservice calls in parallel? Thanks
web-services
delphi
parallel-processing
null
null
null
open
Delphi webservice call not in parallel === I developed an application that get messages through TCP server in parallel and calls a webservice from another webserver application. I noted that parallel requests processed by webservice server in serial. I forced webserver to have delay in response to enhance situation. I traced and found that webservice calls are in parallel by low level Delphi webserivce call serialize calls. I sniffed and found only one connection is opened and HTTP requests are sent one by one after getting response. My base web service call is as bellow var HTTPRIO: THTTPRIO; WS: TelephoneDispachServerSoap; begin try HTTPRIO := THTTPRIO.Create(nil); WS := GetTelephoneDispachServerSoap(false, '',HTTPRIO); CoInitialize(nil); r := WS.MaxMethod(10,20); finally CoUninitialize; end; end; What Should I do to send webservice calls in parallel? Thanks
0
11,411,066
07/10/2012 10:10:55
1,374,266
05/04/2012 06:26:18
3
0
ERRORCODE=-4461, SQLSTATE=42815 in DB2
i have exported some data from schema A (table x)to xml and I am reading the xml and inserting the data into schema B(table y). while inserting the data after 20000 records it says com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][t4][20111][11366][3.63.75] The value of a host variable is too large for its corresponding use. Host variable=1. ERRORCODE=-4461, SQLSTATE=42815 com.ibm.db2.jcc.am.BatchUpdateException: [jcc][t4][102][10040][3.63.75] Batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. I compared the data types of the corresponding columns in table x and table y they are the same. It is BIGINT for the identity(Auto increment) col and LONG VARCHAR in both source and destination.. Kindly help in resolving this issue.
java
sql
db2
db2-connect
null
null
open
ERRORCODE=-4461, SQLSTATE=42815 in DB2 === i have exported some data from schema A (table x)to xml and I am reading the xml and inserting the data into schema B(table y). while inserting the data after 20000 records it says com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][t4][20111][11366][3.63.75] The value of a host variable is too large for its corresponding use. Host variable=1. ERRORCODE=-4461, SQLSTATE=42815 com.ibm.db2.jcc.am.BatchUpdateException: [jcc][t4][102][10040][3.63.75] Batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. I compared the data types of the corresponding columns in table x and table y they are the same. It is BIGINT for the identity(Auto increment) col and LONG VARCHAR in both source and destination.. Kindly help in resolving this issue.
0
11,411,411
07/10/2012 10:30:55
193,251
10/20/2009 16:38:35
1,955
28
How to get current level in c/c++ header file?
Suppose I have a large c header file, which like this: #ifndef xx #define xx .... #ifndef yy #define yy ... #define Type1 Type2 ... #endif ... #endif Now I want to know in which level `Type2`(the level should be xx->yy), how could I do this? Thanks.
c++
c
null
null
null
07/10/2012 13:54:43
not a real question
How to get current level in c/c++ header file? === Suppose I have a large c header file, which like this: #ifndef xx #define xx .... #ifndef yy #define yy ... #define Type1 Type2 ... #endif ... #endif Now I want to know in which level `Type2`(the level should be xx->yy), how could I do this? Thanks.
1
11,411,413
07/10/2012 10:31:06
1,514,460
07/10/2012 10:21:42
1
0
RTMP Streaming in IOS
I am a beginner. I have searched for **free** open source libraries for RTMP streaming in IOS and found out BigBadOwl / iPhone-Rtmpdump. Can any one help me how to add this library to xcode and start working on video streaming from FMS. Thanks & Regards AUK
ios
rtmp
null
null
null
null
open
RTMP Streaming in IOS === I am a beginner. I have searched for **free** open source libraries for RTMP streaming in IOS and found out BigBadOwl / iPhone-Rtmpdump. Can any one help me how to add this library to xcode and start working on video streaming from FMS. Thanks & Regards AUK
0
11,411,445
07/10/2012 10:32:48
1,316,982
04/06/2012 07:37:10
1
0
Rails button_to with multiple line text
I'm writing a Rails application and I have button that I create as follows: <%= button_to t('.upload_html'), ... %> where the ... stand for the other options. So the button should have the text pointed to by .upload_html and it does. Now I want that text to have two lines. In the YAML file I had upload_html: "turn off" and now I want upload_html: "turn<br>off" with a line break inside the button label text. But this does not work. It displays the string literally including the HTML tag without linebreaking. What can I do to force the line break? Thank you!! Best, Patrick
ruby-on-rails
yaml
button-to
null
null
null
open
Rails button_to with multiple line text === I'm writing a Rails application and I have button that I create as follows: <%= button_to t('.upload_html'), ... %> where the ... stand for the other options. So the button should have the text pointed to by .upload_html and it does. Now I want that text to have two lines. In the YAML file I had upload_html: "turn off" and now I want upload_html: "turn<br>off" with a line break inside the button label text. But this does not work. It displays the string literally including the HTML tag without linebreaking. What can I do to force the line break? Thank you!! Best, Patrick
0
11,411,448
07/10/2012 10:32:55
1,083,798
12/06/2011 15:28:13
11
0
Big request on Post or Get in Netty Http
I am using Netty for socket connection mainly. But i also want to use netty to handle some http connections as well. The problem is : the data in the post method sent to Netty Http Server is so large . So Netty raise the exception: Long Frame Exception. Anyone please tell me how to configure Netty accept bigger Post param value. Thank you very much
http
post
netty
null
null
null
open
Big request on Post or Get in Netty Http === I am using Netty for socket connection mainly. But i also want to use netty to handle some http connections as well. The problem is : the data in the post method sent to Netty Http Server is so large . So Netty raise the exception: Long Frame Exception. Anyone please tell me how to configure Netty accept bigger Post param value. Thank you very much
0
11,411,453
07/10/2012 10:33:06
1,401,186
05/17/2012 14:09:59
1
0
connection to ms sql 2005 from php using freetds on centos
I am having a problem connecting to MS SQL 2005 from PHP. I am able to connect from the shell, using... tsql -S 10.0.0.134 -p 1433 -U gareth Entering a simple query works as expected... 1> SELECT @@VERSION AS MSSQL_VERSION 2> go MSSQL_VERSION Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86) Nov 24 2008 13:01:59 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.1 (Build 7601: Service Pack 1) However, trying this from a PHP script does not work... $test = mssql_connect('10.0.0.134:1433', 'gareth', 'mypass'); ... and produces an mssql_connect() [function.mssql-connect]: Unable to connect to server error. I can see the mssql.so module in /usr/lib/php/modules and phpinfo() shows the module is loaded. I'd be happy to use odbc_connect instead if someone could show me an example configuration for freetds.conf and odbc.conf Thanks
php
sql-server
centos
freetds
null
null
open
connection to ms sql 2005 from php using freetds on centos === I am having a problem connecting to MS SQL 2005 from PHP. I am able to connect from the shell, using... tsql -S 10.0.0.134 -p 1433 -U gareth Entering a simple query works as expected... 1> SELECT @@VERSION AS MSSQL_VERSION 2> go MSSQL_VERSION Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86) Nov 24 2008 13:01:59 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.1 (Build 7601: Service Pack 1) However, trying this from a PHP script does not work... $test = mssql_connect('10.0.0.134:1433', 'gareth', 'mypass'); ... and produces an mssql_connect() [function.mssql-connect]: Unable to connect to server error. I can see the mssql.so module in /usr/lib/php/modules and phpinfo() shows the module is loaded. I'd be happy to use odbc_connect instead if someone could show me an example configuration for freetds.conf and odbc.conf Thanks
0
10,704,539
05/22/2012 14:53:40
779,340
06/01/2011 12:16:47
234
22
NoClassDefFoundError org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode in grails application
I have a strange situation in a grails application. My application use spring-security-ui, and I'm using the class _org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode_. The weird stuff is that, when I use this class the application throw an Exception: java.lang.NoClassDefFoundError: org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode but If I try to do a *grails shell* and import that class, it works. Which can be the cause of this error? Thanks
grails
null
null
null
null
null
open
NoClassDefFoundError org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode in grails application === I have a strange situation in a grails application. My application use spring-security-ui, and I'm using the class _org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode_. The weird stuff is that, when I use this class the application throw an Exception: java.lang.NoClassDefFoundError: org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode but If I try to do a *grails shell* and import that class, it works. Which can be the cause of this error? Thanks
0
11,472,926
07/13/2012 14:51:43
139,618
07/16/2009 16:17:44
725
8
ASP.NET MVC Patterns for Multiple Tenants and Plugins?
I am trying to understand how I can create an ASP.NET MVC site that exists as a VS2010 project in a solution, and then for multiple "tenants" I would create a site that inherits from that one. That would give the flexibility of adding modular features to one without affecting another one, and both could benefit from core library optimizations. Is that a crazy idea? What patterns exist for that kind of thing? I have done something similar for a webform-based site (adding DLLS as plugins), but not in MVC. All ideas appreciated. Thanks.
asp.net-mvc
design-patterns
module
null
null
null
open
ASP.NET MVC Patterns for Multiple Tenants and Plugins? === I am trying to understand how I can create an ASP.NET MVC site that exists as a VS2010 project in a solution, and then for multiple "tenants" I would create a site that inherits from that one. That would give the flexibility of adding modular features to one without affecting another one, and both could benefit from core library optimizations. Is that a crazy idea? What patterns exist for that kind of thing? I have done something similar for a webform-based site (adding DLLS as plugins), but not in MVC. All ideas appreciated. Thanks.
0
11,472,936
07/13/2012 14:52:19
326,110
04/26/2010 14:56:52
313
17
Unifying two classes while leaving some extended abilities. Simplicity vs Reusability
Note: My code happens to be in C#, but I don't think that's significant to solving the problem. Problem ======= I'm trying to reduce code duplication in two old classes we have that are both used for loading queries from XML. They both have constructors that take the XML location, both have `Execute` methods that accept a collection of SQL parameters and both provide various static overloaded methods to make it quick and easy to run a query with maybe a single named paramater, or no parameter, or one with a non-default SQL connection object. These static methods also accept the XML location as the parameter, and internally they're calling the constructor, and so on, and finally just returning the first DataTable of the DataSet. public static DataTable GetQuery(string queryName) { ... } public static DataTable GetQuery(string queryName, string parameterName, string parameterValue) { ... } public static DataTable GetQuery(string queryName, Hashtable parameters) { ... } public static DataTable GetQuery(string queryName, Hashtable parameters, IConnection connection) { ... } and so on. The *difference* between the two is that one looks for the XML file in the filesystem, and the other looks for them embedded in the assembly. Possible Solution 1 ======== I was thinking of unifying them into one that can do either, using different implementations of a separate `IQuerySource` interface, passed into the constructor, or something. But this would mean either the constructor would have to always be called ahead of time, or the `GetQuery` methods would need to be passed the `IQuerySource` object every time, as well. I'm trying to avoid things like that, because these `GetQuery` methods are used *everywhere* in the client code, for quick little things like `GetQuery("GetUserDetails","UserID",userId.ToString())`. Possible Solution 2 ======== Alternatively, I could create two very light classes, `FileQuery` and `DllQuery`, that would sit on top of the unified class, and they would always pass `FileQuerySource` and `DllQuerySource` down to the constructor and/or `GetQuery` methods. This would keep the client code small, but I don't want to have maintain (marginally thinner) versions of all the existing `GetQuery` overloads in two more places, in addition to the core class! Possible Solution 3 ======== Another alternative would be like the above, but exposing the unified class so you could call, say, `DllQuery.Q.GetQuery("GetUserDetails","UserID",userId.ToString())`, but then I'm not sure how DllQuery can intercept the call and make sure the Q instance of the unified class always gets the right source for the job. An additional complexity is that to get XML from an assembly, we're currently using `System.Reflection.Assembly.GetCallingAssembly()`, so wherever that's called has to sit directly under the surface of the client code, otherwise we'll get our Data assembly instead of the client assembly. I understand this question might be a bit subjective, but I'm hoping there's some well-understood and well-defined design pattern, or something, for addressing this.
design-patterns
code-reuse
null
null
null
null
open
Unifying two classes while leaving some extended abilities. Simplicity vs Reusability === Note: My code happens to be in C#, but I don't think that's significant to solving the problem. Problem ======= I'm trying to reduce code duplication in two old classes we have that are both used for loading queries from XML. They both have constructors that take the XML location, both have `Execute` methods that accept a collection of SQL parameters and both provide various static overloaded methods to make it quick and easy to run a query with maybe a single named paramater, or no parameter, or one with a non-default SQL connection object. These static methods also accept the XML location as the parameter, and internally they're calling the constructor, and so on, and finally just returning the first DataTable of the DataSet. public static DataTable GetQuery(string queryName) { ... } public static DataTable GetQuery(string queryName, string parameterName, string parameterValue) { ... } public static DataTable GetQuery(string queryName, Hashtable parameters) { ... } public static DataTable GetQuery(string queryName, Hashtable parameters, IConnection connection) { ... } and so on. The *difference* between the two is that one looks for the XML file in the filesystem, and the other looks for them embedded in the assembly. Possible Solution 1 ======== I was thinking of unifying them into one that can do either, using different implementations of a separate `IQuerySource` interface, passed into the constructor, or something. But this would mean either the constructor would have to always be called ahead of time, or the `GetQuery` methods would need to be passed the `IQuerySource` object every time, as well. I'm trying to avoid things like that, because these `GetQuery` methods are used *everywhere* in the client code, for quick little things like `GetQuery("GetUserDetails","UserID",userId.ToString())`. Possible Solution 2 ======== Alternatively, I could create two very light classes, `FileQuery` and `DllQuery`, that would sit on top of the unified class, and they would always pass `FileQuerySource` and `DllQuerySource` down to the constructor and/or `GetQuery` methods. This would keep the client code small, but I don't want to have maintain (marginally thinner) versions of all the existing `GetQuery` overloads in two more places, in addition to the core class! Possible Solution 3 ======== Another alternative would be like the above, but exposing the unified class so you could call, say, `DllQuery.Q.GetQuery("GetUserDetails","UserID",userId.ToString())`, but then I'm not sure how DllQuery can intercept the call and make sure the Q instance of the unified class always gets the right source for the job. An additional complexity is that to get XML from an assembly, we're currently using `System.Reflection.Assembly.GetCallingAssembly()`, so wherever that's called has to sit directly under the surface of the client code, otherwise we'll get our Data assembly instead of the client assembly. I understand this question might be a bit subjective, but I'm hoping there's some well-understood and well-defined design pattern, or something, for addressing this.
0
11,472,937
07/13/2012 14:52:22
1,214,219
02/16/2012 15:49:19
1,665
2
can you make a call to AudioObjectSetPropertyData be synchronous?
I am setting the samplerate of a device using AudioObjectSetPropertyData. Is there a way to make this call be synchronous?
c++
osx
osx-lion
osx-snow-leopard
core-audio
null
open
can you make a call to AudioObjectSetPropertyData be synchronous? === I am setting the samplerate of a device using AudioObjectSetPropertyData. Is there a way to make this call be synchronous?
0
11,472,940
07/13/2012 14:52:33
378,418
06/28/2010 20:18:12
2,086
102
Rotating UIViews become unresponsive
I have a UIViewController subclass that changes its frame when the UI rotates (for example, most commonly, the frame is the same size and centered in both landscape and portrait.) When the view rotates, the view visually changes its frame as expected. But the controls (buttons, scroll views, etc.) that end up in the area of the new frame do not respond to touches. The only controls that respond are the ones that have remained in the original frame (so, if the view moves down and to the left, controls or parts of controls in the upper right corner remain responsive.) Any idea what's going on here? Here's the code that changes the frame: - (void) setLandscape:(bool)bLandscape { if( bLandscape ) [self setFrame:m_landscapeFrame]; else [self setFrame:m_portraitFrame]; } And in the bigger view controller that handles rotation directly: - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { bool bToLandscape= UIInterfaceOrientationIsLandscape(toInterfaceOrientation); [UIView beginAnimations:NULL context:nil]; [UIView setAnimationDuration:duration]; [m_pCurrentWindowViewController setLandscape:bToLandscape]; // (Some unrelated stuff happens here...) [UIView commitAnimations]; } To me this seems like a bug or at least poor design on Apple's part - there should never be a time when a view is in one position visually and another position in terms of control. But I'm just looking for a way to fix this behavior.
objective-c
uiview
uiviewcontroller
rotation
uiinterfaceorientation
null
open
Rotating UIViews become unresponsive === I have a UIViewController subclass that changes its frame when the UI rotates (for example, most commonly, the frame is the same size and centered in both landscape and portrait.) When the view rotates, the view visually changes its frame as expected. But the controls (buttons, scroll views, etc.) that end up in the area of the new frame do not respond to touches. The only controls that respond are the ones that have remained in the original frame (so, if the view moves down and to the left, controls or parts of controls in the upper right corner remain responsive.) Any idea what's going on here? Here's the code that changes the frame: - (void) setLandscape:(bool)bLandscape { if( bLandscape ) [self setFrame:m_landscapeFrame]; else [self setFrame:m_portraitFrame]; } And in the bigger view controller that handles rotation directly: - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { bool bToLandscape= UIInterfaceOrientationIsLandscape(toInterfaceOrientation); [UIView beginAnimations:NULL context:nil]; [UIView setAnimationDuration:duration]; [m_pCurrentWindowViewController setLandscape:bToLandscape]; // (Some unrelated stuff happens here...) [UIView commitAnimations]; } To me this seems like a bug or at least poor design on Apple's part - there should never be a time when a view is in one position visually and another position in terms of control. But I'm just looking for a way to fix this behavior.
0
11,472,944
07/13/2012 14:52:56
1,023,164
11/01/2011 06:05:07
267
25
Finding the coordinates of a letter placed on TextView
I have a textview which contains longs text that covers half of the screen, In this textview I have two words at different position above which I have to place a blank layout which will give it a glass effect. I can do this by placing the textview in a framelayout and placing the layout above it. The problem is how will I get the coordinates of the words, as the text may be arranged at different position on different devices.
android
android-layout
null
null
null
null
open
Finding the coordinates of a letter placed on TextView === I have a textview which contains longs text that covers half of the screen, In this textview I have two words at different position above which I have to place a blank layout which will give it a glass effect. I can do this by placing the textview in a framelayout and placing the layout above it. The problem is how will I get the coordinates of the words, as the text may be arranged at different position on different devices.
0
11,472,861
07/13/2012 14:48:33
1,432,788
06/02/2012 19:07:03
1
0
SQL server convert datetime using LINQ
I have the query I need in SQL server but I'm using Entity Framework and would like the same results using LINQ. Here is the SQL: select convert(varchar, date_recorded, 12), MAX(outdoor_temp), MAX(wind_speed) from weatherdata group by convert(varchar, date_recorded, 12) order by convert(varchar, date_recorded, 12) DESC ; This converts my datetime column to a correct format that allows me to group properly. Basically I need to be able to convert my SQL datetime to yymmdd format. Many thanks
sql
linq
entity-framework
convert
null
null
open
SQL server convert datetime using LINQ === I have the query I need in SQL server but I'm using Entity Framework and would like the same results using LINQ. Here is the SQL: select convert(varchar, date_recorded, 12), MAX(outdoor_temp), MAX(wind_speed) from weatherdata group by convert(varchar, date_recorded, 12) order by convert(varchar, date_recorded, 12) DESC ; This converts my datetime column to a correct format that allows me to group properly. Basically I need to be able to convert my SQL datetime to yymmdd format. Many thanks
0
11,472,862
07/13/2012 14:48:35
1,523,639
07/13/2012 13:12:11
3
0
fastest way to achieve mutual exclusion in a single cpu system
hi guys just wondering whats the fastest way to get mutual exclusion.Is it using critical section, producer - consumer problem but this can lead to deadlock where both go idle waiting for each other
operating-system
critical-section
null
null
null
null
open
fastest way to achieve mutual exclusion in a single cpu system === hi guys just wondering whats the fastest way to get mutual exclusion.Is it using critical section, producer - consumer problem but this can lead to deadlock where both go idle waiting for each other
0
11,472,863
07/13/2012 14:48:35
1,517,491
07/11/2012 10:41:21
1
0
Sunspot Solr Autocomplete not working Ruby on Rails 3.2.3
I need helping getting Autocomplete working on my Solr Search bar. Am, using this https://github.com/xponrails/sunspot_autocomplete Followed the steps & it doesn't work. I get stuck at my search bar -how do I add it to it, while keeping the params[:search] Someone else had the same problem, but deleted their code that got it working. Thank You =)
ruby
ruby-on-rails-3.2
sunspot-rails
sunspot-solr
null
null
open
Sunspot Solr Autocomplete not working Ruby on Rails 3.2.3 === I need helping getting Autocomplete working on my Solr Search bar. Am, using this https://github.com/xponrails/sunspot_autocomplete Followed the steps & it doesn't work. I get stuck at my search bar -how do I add it to it, while keeping the params[:search] Someone else had the same problem, but deleted their code that got it working. Thank You =)
0
11,472,949
07/13/2012 14:53:11
1,205,102
02/12/2012 13:18:41
116
1
Jquery - a plugin that automatically animates the scrolling to the bottom of the page
Im wondering if some of you knows a jquery plugin that automatically animates the scrolling to the bottom of the page. something that does this basically, but considering all the exceptions: $bottom = 50; function scroll() { $('html, body').animate({scrollTop:$bottom}, 4000, 'linear'); $bottom = $bottom + 50; scroll(); } scroll();
jquery
plugins
scroll
null
null
null
open
Jquery - a plugin that automatically animates the scrolling to the bottom of the page === Im wondering if some of you knows a jquery plugin that automatically animates the scrolling to the bottom of the page. something that does this basically, but considering all the exceptions: $bottom = 50; function scroll() { $('html, body').animate({scrollTop:$bottom}, 4000, 'linear'); $bottom = $bottom + 50; scroll(); } scroll();
0
11,651,290
07/25/2012 13:51:17
426,422
08/20/2010 14:07:43
743
82
Invoking method without using the name of the method
I recently saw some code like this (which is calling a delegate): public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext) { Debug.WriteLine(string.Format("Second watch: Method '{0}' on object '{1}' was invoked and caught in order {2}.", input.MethodBase.Name, input.Target.GetType(),Order)); return getNext()(input, getNext); } Can someone explain and \ or post a link explaining what is happening here. I understand Invoke() is being called but why is the name optional in this case?
c#
null
null
null
null
null
open
Invoking method without using the name of the method === I recently saw some code like this (which is calling a delegate): public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext) { Debug.WriteLine(string.Format("Second watch: Method '{0}' on object '{1}' was invoked and caught in order {2}.", input.MethodBase.Name, input.Target.GetType(),Order)); return getNext()(input, getNext); } Can someone explain and \ or post a link explaining what is happening here. I understand Invoke() is being called but why is the name optional in this case?
0
11,651,303
07/25/2012 13:51:58
1,304,357
03/31/2012 00:18:27
47
0
time function in C
In shell scripting, when ever I want the local time I do something like date +%s from the command line and it returns me the current date and time in this format "1343221713" I am wondering whether there is a way to achieve the same result in C
c
datetime
time
null
null
null
open
time function in C === In shell scripting, when ever I want the local time I do something like date +%s from the command line and it returns me the current date and time in this format "1343221713" I am wondering whether there is a way to achieve the same result in C
0
11,651,304
07/25/2012 13:51:58
1,082,345
12/05/2011 20:58:23
1
0
HTML5 Canvas - Performance difference between portrait and landscape on retina display
We're using a scaling technique to improve the resolution of our canvas web apps on the retina display. Basically, the technique described here: http://zsprawl.com/iOS/2012/03/html5-canvas-and-retina-displays/ However, we've noticed a SIGNIFICANT performance difference when running in landscape mode vs portrait mode. I've set up a jsFiddle test app to demonstrate this. You can notice the difference if you view the embedded version: http://jsfiddle.net/SaJ69/embedded/result/ (removing the /embedded/result/ will take you to the original fiddle. I could only have a post with 2 links in it) If you switch between portrait and landscape when viewing this on an iPad3 (you'll need to refresh the browser window between switches) you can see that portrait mode is choppier than landscape. When running this on my own webserver (not through jsFiddle), the results are much more noticeable. I tried to do some frame rate metrics, but they're only measuring the number of times we make draw calls, not the number of times the browser will actually update. Anyone have any insight into this? Is this a hardware related issue? We are theoretically doing the same draw calls and filling the same number of pixels right? -Chris
html5
web-applications
canvas
retinadisplay
ipad-3
null
open
HTML5 Canvas - Performance difference between portrait and landscape on retina display === We're using a scaling technique to improve the resolution of our canvas web apps on the retina display. Basically, the technique described here: http://zsprawl.com/iOS/2012/03/html5-canvas-and-retina-displays/ However, we've noticed a SIGNIFICANT performance difference when running in landscape mode vs portrait mode. I've set up a jsFiddle test app to demonstrate this. You can notice the difference if you view the embedded version: http://jsfiddle.net/SaJ69/embedded/result/ (removing the /embedded/result/ will take you to the original fiddle. I could only have a post with 2 links in it) If you switch between portrait and landscape when viewing this on an iPad3 (you'll need to refresh the browser window between switches) you can see that portrait mode is choppier than landscape. When running this on my own webserver (not through jsFiddle), the results are much more noticeable. I tried to do some frame rate metrics, but they're only measuring the number of times we make draw calls, not the number of times the browser will actually update. Anyone have any insight into this? Is this a hardware related issue? We are theoretically doing the same draw calls and filling the same number of pixels right? -Chris
0
11,636,343
07/24/2012 17:41:39
329,737
04/30/2010 12:13:39
312
6
What does it mean in the changelog of msysgit 1.7.11 when it says: An experimental "version 4" format of the index file
As stated in the title, what do they mean: An experimental "version 4" format of the index file has been introduced to reduce on-disk footprint and I/O overhead More importantly, is there a risk in losing backwards compatibility with this change, or could this change corrupt the repository? Doing some testing suggests that it's backwards compatible and did not reveal any adverse effects. Could somebody please clarify what this change actually is to msysgit 1.7.11?
git
msysgit
null
null
null
null
open
What does it mean in the changelog of msysgit 1.7.11 when it says: An experimental "version 4" format of the index file === As stated in the title, what do they mean: An experimental "version 4" format of the index file has been introduced to reduce on-disk footprint and I/O overhead More importantly, is there a risk in losing backwards compatibility with this change, or could this change corrupt the repository? Doing some testing suggests that it's backwards compatible and did not reveal any adverse effects. Could somebody please clarify what this change actually is to msysgit 1.7.11?
0
11,430,654
07/11/2012 10:27:31
1,039,947
11/10/2011 14:26:40
2,465
89
Is it possible to use Type.GetType with a dynamically loaded assembly?
Say I have this little bit of code: public static void LoadSomething(Type t) { var t1 = Type.GetType(t.AssemblyQualifiedName); var t2 = t .Assembly .GetTypes() .First(ta => ta.AssemblyQualifiedName == t.AssemblyQualifiedName); } What happens is that t1 is **null** and t2 is **not null**. I was confused since if I call it like so... LoadSomething(typeof(SomeObject)); then **neither** are null but what I am actually doing is more like this (not really, this is massively simplified but it illustrates my point): LoadSomething(Assembly.LoadFile(@"C:\....dll").GetTypes().First()); So the first part of my question (for my information) is... In the second case, since the assembly must be loaded up and I found the type out of it why doesn't Type.GetType work? And secondly (to actually solve my problem)... Is there some other way that I could load a type when I only have the assembly qualified name as a string that I know has been previously loaded by using the Assembly.Load methods?
c#
.net
null
null
null
null
open
Is it possible to use Type.GetType with a dynamically loaded assembly? === Say I have this little bit of code: public static void LoadSomething(Type t) { var t1 = Type.GetType(t.AssemblyQualifiedName); var t2 = t .Assembly .GetTypes() .First(ta => ta.AssemblyQualifiedName == t.AssemblyQualifiedName); } What happens is that t1 is **null** and t2 is **not null**. I was confused since if I call it like so... LoadSomething(typeof(SomeObject)); then **neither** are null but what I am actually doing is more like this (not really, this is massively simplified but it illustrates my point): LoadSomething(Assembly.LoadFile(@"C:\....dll").GetTypes().First()); So the first part of my question (for my information) is... In the second case, since the assembly must be loaded up and I found the type out of it why doesn't Type.GetType work? And secondly (to actually solve my problem)... Is there some other way that I could load a type when I only have the assembly qualified name as a string that I know has been previously loaded by using the Assembly.Load methods?
0
11,430,626
07/11/2012 10:25:59
1,391,407
05/12/2012 18:49:54
8
0
Regex for finding all href and src and replace them with fully quilifies urls
I need to find all src and href's in a string and replace them with a fully quilifies url. ex: src="/test/style.css?somethinghere" becomes src="http://www.mydomain.com/test/style.css?somethinghere" and the same goes for href's. I will use them in a web relay server. I will use regex replace, but what does the regex look like?
regex
null
null
null
null
null
open
Regex for finding all href and src and replace them with fully quilifies urls === I need to find all src and href's in a string and replace them with a fully quilifies url. ex: src="/test/style.css?somethinghere" becomes src="http://www.mydomain.com/test/style.css?somethinghere" and the same goes for href's. I will use them in a web relay server. I will use regex replace, but what does the regex look like?
0
11,430,665
07/11/2012 10:27:59
1,517,433
07/11/2012 10:18:52
1
0
Display time duration as hourly in mysql
Suppose i have logged into a site at 10 and done some jobs and logged out at 14. in my parent table i had login time and logout time and in child talbe i had eachjob's start time and end time. say suppose during all this time i have done 50 jobs. I want to display hourly jobs .How to do in mysql? Session # jobs 1000-1100 12 1100-1200 11 1200-1300 11 1300-1400 16
mysql
time
display
null
null
null
open
Display time duration as hourly in mysql === Suppose i have logged into a site at 10 and done some jobs and logged out at 14. in my parent table i had login time and logout time and in child talbe i had eachjob's start time and end time. say suppose during all this time i have done 50 jobs. I want to display hourly jobs .How to do in mysql? Session # jobs 1000-1100 12 1100-1200 11 1200-1300 11 1300-1400 16
0
11,430,666
07/11/2012 10:28:03
1,490,145
06/29/2012 02:42:01
44
0
push buttons are not working correctly
I have 2 push buttons, I am trying to state that if "1" button is on, turn off the "2" button, else if the "2" button is on, then turn off the "1" button. But at the moment what is happening is that if I turn on the "2" button, and then turn on the "1" button, then this works fines as "1" button turns on and "2" button turns off. But if I then try and turn "2" button on again, it doesn't turn it on, it remains off and button "1" remains on. Does anyone know why this is happening? Below is code: function btnclick(btn) { var context = $(btn).parents('#optionAndAnswer'); $(btn).toggleClass("answerBtnsOff"); $(btn).toggleClass("answerBtnsOn"); if ($("#answer1", context).hasClass('answerBtnsOn')) { $("#answer2", context).removeClass('answerBtnsOn').addClass('answerBtnsOff'); } else if ($("#answer2", context).hasClass('answerBtnsOn')) { $("#answer1", context).removeClass('answerBtnsOn').addClass('answerBtnsOff'); } return false; } below is html for both 1 and 2 buttons: 1 button: <input class="answerBtns answers answerBtnsOff" id="answer1" type="button" value="1" onclick="btnclick(this);"/> 2 Button: <input class="answerBtns answers answerBtnsOff" id="answer2" type="button" value="2" onclick="btnclick(this);"/>
jquery
null
null
null
null
null
open
push buttons are not working correctly === I have 2 push buttons, I am trying to state that if "1" button is on, turn off the "2" button, else if the "2" button is on, then turn off the "1" button. But at the moment what is happening is that if I turn on the "2" button, and then turn on the "1" button, then this works fines as "1" button turns on and "2" button turns off. But if I then try and turn "2" button on again, it doesn't turn it on, it remains off and button "1" remains on. Does anyone know why this is happening? Below is code: function btnclick(btn) { var context = $(btn).parents('#optionAndAnswer'); $(btn).toggleClass("answerBtnsOff"); $(btn).toggleClass("answerBtnsOn"); if ($("#answer1", context).hasClass('answerBtnsOn')) { $("#answer2", context).removeClass('answerBtnsOn').addClass('answerBtnsOff'); } else if ($("#answer2", context).hasClass('answerBtnsOn')) { $("#answer1", context).removeClass('answerBtnsOn').addClass('answerBtnsOff'); } return false; } below is html for both 1 and 2 buttons: 1 button: <input class="answerBtns answers answerBtnsOff" id="answer1" type="button" value="1" onclick="btnclick(this);"/> 2 Button: <input class="answerBtns answers answerBtnsOff" id="answer2" type="button" value="2" onclick="btnclick(this);"/>
0
11,430,667
07/11/2012 10:28:08
1,326,864
04/11/2012 14:30:01
9
1
Symfony 1.4 sfWidgetFormInputFileEditable customization
I am using the sfWidgetFormInputFileEditable widget for my users to upload images. I would like to see if there's a way to alter the way it works be default. When a user is adding a "new" object, I would like for it to show a generic picture, and when it's an "edit" then it can show the existing pic. I tried writing a PHP conditional statement but that's not working for me because when it's a "new" item I can't pull the parameter "getPicture1" because it doesn't exist. Thanks! My widget currently: $this->widgetSchema['picture1'] = new sfWidgetFormInputFileEditable(array( 'label' => ' ', 'file_src' => '/uploads/car/'.$this->getObject()->getPicture1(), 'is_image' => true, 'edit_mode' => true, 'template' => '<div>%file%<br />%input%</div>', ));
image
file
generics
symfony
upload
null
open
Symfony 1.4 sfWidgetFormInputFileEditable customization === I am using the sfWidgetFormInputFileEditable widget for my users to upload images. I would like to see if there's a way to alter the way it works be default. When a user is adding a "new" object, I would like for it to show a generic picture, and when it's an "edit" then it can show the existing pic. I tried writing a PHP conditional statement but that's not working for me because when it's a "new" item I can't pull the parameter "getPicture1" because it doesn't exist. Thanks! My widget currently: $this->widgetSchema['picture1'] = new sfWidgetFormInputFileEditable(array( 'label' => ' ', 'file_src' => '/uploads/car/'.$this->getObject()->getPicture1(), 'is_image' => true, 'edit_mode' => true, 'template' => '<div>%file%<br />%input%</div>', ));
0