Looking to make a site similar to just*answer.com (remove the star). What languages are required to do this assuming it is based on LAMP and open source?
I was given the daunting task of converting a ASP website to PHP and MSSQL to MySQL, and I ran into an issue that hopefully somebody can help
I have a user table which has a password field with datatype Varbinary(128), are using pwdencrypt to encrypt the password.
Is there a way to transfer that over to MySQL, and somehow i need to be able to keep the password intact... how can i go about that? any pointers would be greatly appreciated!
I've got multiple structures to maintain in my application. All link to the same records, and one of them could be considered the "master" in that it reflects actual relationships held in files on disk. The other structures are used to "call out" elements of the main design for purchase and work orders. I'm struggling to come up with a pattern that deals appropriately with changes to the master data.
As an example, the following trees might refer to the same data:
A
|_
B
|_
C
|_
D
|_
E
|_
B
|_
C
|_
D
A
|_
B
E
C
|_
D
A
|_
B
C
D
E
These secondary structures follow internal rules, but their overall structure is usually user-determined. In all cases (including the master), any element can be used in multiple locations and in multiple trees. When I add a child to any element in the tree, I want to either automatically build the secondary structure for each instance of the "master" element or at least advertise the situation to the user and allow them to manually generate the data required for the secondary trees.
Is there any pattern which might apply to this situation? I've been treating it as a view problem, but it turns out to be more complicated than that when you look at the initial generation of the data.
I've got a WPF RenderTargetBitmap in C++/CLI and I want to be able to create a BITMAP structure from it to use with BitBlt. I've not worked with BITMAP or RenderTargetBitmap much before, so any thoughts would be great!
I need some information about the Informatica ETL tool. I am a rookie with that, so could you please recommend where can I get some tutorials to get started. Can I download the tool, and if so where can I download it? What are the alternatives to Informatica?
My credit card processor requires I send a two-digit year from the credit card expiration date. Here is how I a currently processing:
I put a DropDownList of the 4-digit year on the page.
I validate the expiration date in a DateTime field to be sure that the expiration date being passed to the CC processor isn't expired.
I send a two-digit year to the CC processor (as required). I do this via a substring of the value from the year DDL.
Is there a method out there to convert a four-digit year to a two-digit year. I am not seeing anything on the DateTime object. Or should I just keep processing it as I am?
I'm trying to gain a basic understanding of what is meant by a Windows code page. I kind of get the feeling it's a translation between a given 8 bit value and some 'abstraction' for a given character graphic.
I made the following experiment. I created a "" character literal with two versions of the letter u with an umlaut. One created using the ALT 129 (uses code page 437) value and one using the ALT 0252 (uses code page 1252) value. When I examined the literal both characters had the value 252.
Is 252 the universal 8 bit abstraction for u with an umlaut? Is it the Unicode value?
Aside from keyboard input are there any library routines or system calls that use code pages?
For example is there a function to translate a string using a given code table (as above for the ALT 129 value)?
Is it possible to define resource references that are applicable to all EJBs in an application?
Currently I have an ejb-jar.xml that looks something like this:
<ejb-jar>
<enterprise-beans>
<session id="foo">
<!-- snip -->
<resource-ref>
<res-ref-name>jdbc/myDatasource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
<session id="bar">
<!-- snip -->
<resource-ref>
<res-ref-name>jdbc/myDatasource</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
</enterprise-beans>
</ejb-jar>
You'll notice that both EJBs have the same resource-ref defined for both of them. Is there a way to factor this duplication out within a J2EE 1.4 application?
Ideally I should be able to define the jdbc/myDatasource resource once within the application and have anything running inside that container be able to access it by doing a JNDI lookup for "java:comp/env/jdbc/myDatasource". Is there any way to accomplish this?
I've got two models
class SurveyResponse
has_many :answers, :class_name => SurveyResponseAnswer.name
accepts_nested_attributes_for :answers
end
class SurveyResponseAnswer
belongs_to :survey_response
validates_presence_of :answer_text
end
In my nested form if validation fails I get this error displayed on the screen:
"answers answer text can't be blank"
I've customized my attribute names somewhat successfully using rails I18n. It doesn't behave exactly how I would expect though. The yml file below doesn't affect how the attribute name is printed in error_messages_for
en:
activerecord:
models:
survey_response:
answers: "Response"
But if from script/console I try
SurveyResponse.human_attribute_name("answers")
I get the expected result of "Response".
What I'd like to do is have the validation error message say:
"Response answer text can't be blank". Any ideas what I need to fix?
I am trying to create a MySQL Trigger to disable someone's account if they have logged in to the site 3 times. I have tried to create this trigger using the following code, but it is not setting is_active to 0 no matter what times_logged_in is. Any help would be appreciated.
CREATE TRIGGER updateTrigger AFTER UPDATE ON users
FOR EACH ROW
BEGIN
UPDATE users SET is_active=0 WHERE NEW.is_code=1
AND NEW.times_logged_in>=3
AND NEW.user_id=user_id;
END;
IE yet again is proving to be the bane of my existence. The top of a site I'm working on has a horizontal menu, an item of which triggers a pure-CSS menu that is positioned absolute within the parent menu DIV (positioned relative). This places the menu perfectly in both IE and the W3C compliant browsers.
The problem arises when I have more positioned elements further down on the page. These are also positioned relative, because there is data inside them that needs to be positioned absolute... again, this displays properly in all browsers I've tested it on.
The problem is, that then the top menu is opened, part is obscured by the positioned elements further down the page - in effect, it's positioned BELOW these elements even though there are z-index properties defined on all. (in both the CSS file and inline).
The only way to get IE to display this properly is to place the actual HTML for the menu at the bottom of the page, below (in DOM terms) the positioned elements elsewhere on the page. I would only do this as an absolute last resort.
All Elements are the same type (div). Here is the relevant HTML:
<div id='menu'>
<div id='cat_menu' style='display:none;z-index:10000;'>
<table cellspacing='0' cellpadding='0' class='brmenu' width='100%'>
[data]
</table>
</div>
<div class='product_new' style='z-index:20;'>[data]</div>
<div class='product_listing' style='background-color:#FFFFFF;'>[data]</div>
And the relevant CSS:
div#menu {
height: 26px;
padding: 0;
position: relative;
}
div#cat_menu {
position: absolute;
top: 25px;
left: 115px;
width: 300px;
z-index: 1000;
}
div.product_new {
background-image: url("/images/sp_images.png");
background-position: 0 -108px;
background-repeat: no-repeat;
padding 0px;
height: 40px;
font-size: 9pt;
margin-top: 5px;
position: relative;
z-index: 20;
}
What I have is a txt file that is huge, 60MB. I need to read each line and produce a file, split based on a delimiter. I'm having no issue reading the file or producing the file, my complication comes from the delimiter, it can't see the delimiter. If anybody could offer a suggestion on how to read that delimiter I would be so grateful.
delimiter = Ç
public void file1()
{
string betaFilePath = @"C:\dtable.txt";
StringBuilder sb = new StringBuilder();
using (FileStream fs = new FileStream(betaFilePath, FileMode.Open))
using (StreamReader rdr = new StreamReader(fs))
{
while (!rdr.EndOfStream)
{
string[] betaFileLine = rdr.ReadLine().Split('Ç');
{
sb.AppendLine(betaFileLine[0] + "ç" + betaFileLine[1] + betaFileLine[2] + "ç" + betaFileLine[3] + "ç" + betaFileLine[4] + "ç" + betaFileLine[5] + "ç" + betaFileLine[6] + "ç" + betaFileLine[7] + "ç" + betaFileLine[8] + "ç" + betaFileLine[9] + "ç" + betaFileLine[10] + "ç");
}
}
}
using (FileStream fs = new FileStream(@"C:\testarea\load1.txt", FileMode.Create))
using (StreamWriter writer = new StreamWriter(fs))
{
writer.Write(sb.ToString());
}
}
I have been getting into RIA services because I thought it would simplify dealing with the services layer of web applications I wish to build. I see lots of examples out there showing how to create DomainService classes which expose and consume entities that have some kind of relational database backing, and therefore have foreign-key relationships. However, I would like to know how to expose and consume normal object graphs...objects that contain references to eachother but don't have foreign keys.
For example, say I want a service operation called "GetFolderInformation(string pathToFolder)". I want this to return a custom object called "FolderInformation" structured with:
- string Name
- IEnumerable<FileInformation> Files
I cannot get this to work because it seems that RIA wants to deal with entities that have foreign key relationships. Why? Why can't the serializer just see my object references and recreate that in the proxy on the other side?
Data exists behind service layers that doesn't necessarily have foreign key relationships...like folder/file for example.
EDIT: I realized I hadn't asked my question! My question is, is there a way to do what I am trying to do?
var query = from emp in dbEmp.Employees
join dept in dbEmp.Departments
on emp.DeptID equals dept.DeptID
where dept.DepartmentName.Contains(this.TextBox1.Text)
select new
{
EmpID = emp.EmpID,
EmpName = emp.EmpName,
Age = emp.Age,
Address = emp.Address,
DeptName = dept.DepartmentName
};
if (query==null)
Label1.Text = "no results match your search";
GridView1.DataSource = query;
GridView1.DataBind();
Everything works in the right way, but the label doesn't show the message when query result returns null. The label can show without condition(querry==null). So how to test if a var query result returns nothing? Thanks
Hi,
My "Privacy Policy" page is seen more important by Google than other really more important pages on my website.
I'm currently creating a script to generate a sitemap, should I bother with the priority?
How do you effectively assign priorities to pages? I consider one of my page important but the page have less content than another one less important to my eyes... but maybe Google bot will see it the other way around.
If my degree of "importantness" differs from the one of Google, will I get penalized on the ranking for a particular page?
Thank you for sharing your black art with us :P
I have an app with a tab bar, and nav controllers in each tab. When user shakes the device, a UIImageView appears as a child view in the nav controller. But the UIImageView must contain a special image, depending on the device's current orientation.
If I write just
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)
if (interfaceOrientation == UIInterfaceOrientationPortrait|| interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
//Code
}
else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight||interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
//Code
}
}
The view just goes crazy if user rotated the device before shaking. Is there a method to get iPhones current orientation?
There's a bug in delphi 6 which you can find some reference online for when you import a tlb the order of the parameters in an event invocation is reversed. It is reversed once in the imported header and once in TServerEventDIspatch.Invoke.
you can find more information about it here:
http://cc.embarcadero.com/Item/16496
somewhat related to this issue there appears to be a memory leak in TServerEventDispatch.Invoke with a parameter of a Variant of type Var_Array (maybe others, but this is the more obvious one i could see). The invoke code copies the args into a VarArray to be passed to the event handler and then copies the VarArray back to the args after the call, relevant code pasted below:
// Set our array to appropriate length
SetLength(VarArray, ParamCount);
// Copy over data
for I := Low(VarArray) to High(VarArray) do
VarArray[I] := OleVariant(TDispParams(Params).rgvarg^[I]);
// Invoke Server proxy class
if FServer <> nil then FServer.InvokeEvent(DispID, VarArray);
// Copy data back
for I := Low(VarArray) to High(VarArray) do
OleVariant(TDispParams(Params).rgvarg^[I]) := VarArray[I];
// Clean array
SetLength(VarArray, 0);
There are some obvious work-arounds in my case: if i skip the copying back in case of a VarArray parameter it fixes the leak. to not change the functionality i thought i should copy the data in the array instead of the variant back to the params but that can get complicated since it can hold other variants and seems to me that would need to be done recursively.
Since a change in OleServer will have a ripple effect i want to make sure my change here is strictly correct.
can anyone shed some light on exactly why memory is being leaked here? I can't seem to look up the callstack any lower than TServerEventDIspatch.Invoke (why is that?)
I imagine that in the process of copying the Variant holding the VarArray back to the param list it added a reference to the array thus not allowing it to be release as normal but that's just a rough guess and i can't track down the code to back it up.
Maybe someone with a better understanding of all this could shed some light?
Is there a way to have a recursive lambda expression in scheme without relying an external identifier?
I know you can have
(define fact (lambda (n) (if (= n 0) 1 (fact (- n 1))))
but it would be nice if fact wasn't hard coded in the lambda expression, it seems improper.
I tried to do it 2 different ways, but neither way worked.
@Component
public class EmailForm{
...
private QuestionDAO questionDAO;
...
@Autowired
public void setQuestionDAO(QuestionDAO questionDAO) {
this.questionDAO = questionDAO;
}
...
Another way:
@Component
public class EmailForm implements ApplicationContextAware {
...
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.questionDAO = (QuestionDAO)applicationContext.getBean("questionDAO");
}
...
Neither way results in questionDAO being injected
Form bean is populated by spring:
@RequestMapping(method = RequestMethod.POST)
public String submit(@Valid final EmailForm emailForm, BindingResult result, final Model model) {
Hi,
Can someone who uses CJ's Commission Detail Service (REST) tell me what a sample XML response is for this query.
None of CJ's Web Services documentation indicates exactly how the XML is formatted and as I don't have any commission payments yet I can only guess the result.
I want to use maxima from python using pexpect, whenever maxima starts it will print a bunch of stuff of this form:
$ maxima
Maxima 5.27.0 http://maxima.sourceforge.net
using Lisp SBCL 1.0.57-1.fc17
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1)
i would like to start up pexpect like so:
import pexpect
cmd = 'maxima'
child = pexpect.spawn(cmd)
child.expect (' match all that stuff up to and including (%i1)')
child.sendline ('integrate(sin(x),x)')
chil.expect( match (%o1 ) )
print child.before
how do i match the starting banner up to the prompt (%i1)?
and so on, also maxima increments the (%i1)'s by one as the session goes along, so the next expect would be:
child.expect ('match (%i2)')
child.sendline ('integrate(sin(x),x)')
chil.expect( match (%o2 ) )
print child.before
how do i match the (incrementing) integers?
Consider this Python code for printing a list of comma separated values
for element in list:
print element + ",",
What is the preferred method for printing such that a comma does not appear if element is the final element in the list.
ex
a = [1, 2, 3]
for element in a
print str(element) +",",
output
1,2,3,
desired
1,2,3