I'm a programmer for some time now yet I haven't found the right websites which offer me the information I'm interested in. I've looked at TechCrunch, Slashdot, etc. but there wasn't so much actually about programming.
When something urgently important happens in the programming world, where could I read it first?
What are some good sites/communities around programming?
I'm toying around with OCaml. The first thing I want to know how to do is build an OCaml project. Right now, I just want something stupidly simple since I'm just learning. Could anyone point me towards a build system along with a "hello world" type example for using that build system?
I was wondering if anyone knows of a jQuery or MooTools script that will do the exact same thing as YOOcarousel (http://tools.yootheme.com/extensions/yoocarousel).
I'm looking to emulate the 'List Styling' setup they have where on the left you have the tabbed navigation and on the right it fades in/out thru each of the tabbed items as they are clicked.
Thanks,
Ryan
I'm undertaking a rather large conversion from a legacy database-driven Windows app to a Rails app. Because of the large number of forms and database tables involved, I want to make sure I've got the right methodology before getting too far.
My chief concern is minimizing the amount of code I have to write. There are many models that interact together, and I want to make sure I'm using them correctly. Here's a simplified set of models:
class Patient < ActiveRecord::Base
has_many :PatientAddresses
has_many :PatientFileStatuses
end
class PatientAddress < ActiveRecord::Base
belongs_to :Patient
end
class PatientFileStatus < ActiveRecord::Base
belongs_to :Patient
end
The controller determines if there's a Patient selected; everything else is based on that.
In the view, I will be needing data from each of these models. But it seems like I have to write an instance variable in my controller for every attribute that I want to use. So I start writing code like this:
@patient = Patient.find(session[:patient])
@patient_addresses = @patient.PatientAddresses
@patient_file_statuses = @patient.PatientFileStatuses
@enrollment_received_when = @patient_file_statuses[0].EnrollmentReceivedWhen
@consent_received = @patient_file_statuses[0].ConsentReceived
@consent_received_when = @patient_file_statuses[0].ConsentReceivedWhen
The first three lines grab the Patient model and its relations. The next three lines are examples of my providing values to the view from one of those relations.
The view has a combination of text fields and select fields to show the data above. For example:
<%= select("patientfilestatus", "ConsentReceived", {"val1"="val1", "val2"="val2", "Written"="Written"}, :include_blank=true )%
<%= calendar_date_select_tag "patient_file_statuses[EnrollmentReceivedWhen]", @enrollment_complete_when, :popup=:force %
(BTW, the select tag isn't really working; I think I have to use collection_select?)
My questions are:
Do I have to manually declare the value of every instance variable in the controller, or can/should I do it within the view?
What is the proper technique for displaying a select tag for data that's not the primary model?
When I go to save changes to this form, will I have to manually pick out the attributes for each model and save them individually? Or is there a way to name the fields such that ActiveRecord does the right thing?
Thanks in advance,
Aaron.
Hey there.
I am very unfamiliar with nginx, as a forewarning, and also can't find any actual references on the regex system they use. So right now it's a black box to me.
All I want to do is redirect a user trying to go to www.mydomain.com/mydirectory/X to www.myotherdomain.com/X .
Seems like I should be using the rewrite command but the syntax of the regex is eluding me.
Thanks in advance.
I am using html, tag:
<input type = "file" />
On android and on many cellulars I have the ability to get the file directly by taking a picture and save it.
How can I know (by javascript code) how did I get the picture (direcly by the camera, or by some files that on my cellular)?
I did some workarround, and found exif (http://www.nihilogic.dk/labs/exif/exif.js), but I didn't succeed using it, either I don't know whether exif is the right solution.
Thanks :)
I need to choose right architecture model for my solution(client-server, web application, web services).
Can you please tell me what questions I must answer to make good decision?
thanks
For example I found great uml tool (http://www.architexa.com/start/pricing) that is free for 30 days. Can I use screenshots from it in open-source and commercial website? (I have mine open-source project, but Id also like to use it at work)
since its mine for 30 days, I should be able to do whatever I want with it, right?
Hello, given the following structure:
struct nmslist_elem_s {
nmptr data;
struct nmslist_elem_s *next;
};
typedef struct nmslist_elem_s nmslist_elem;
Where:
typedef void* nmptr;
Is it possible to write a MACRO that retrieves the data from the element and cast it to the right type:
MACRO(type, element) that expands to *((type*)element->data).
For example for int, i would need something like this: *((int*)(element->data)) .
I am trying to write the following without using dot notation ...
[scrollView setMinimumZoomScale: scrollView.bounds.size.width / image.size.width];
Is this right?
[scrollView setMinimumZoomScale: [scrollView bounds].size.width / [image size].width];
cheers Gary.
I heard that using shorts on 32bit system is just more inefficient than using ints. Is this the same for ints on a 64bit system?
Python recently(?) basically merged ints with long and has basically a single datatype long, right? If you are sure that your app. will only run on 64bit then, is it even conceivable (potentially a good idea) to use long for everything in Java?
Does the standard specify the official C++ grammar?
I searched, but did not find it anywhere.
Also, I wish to read a bit about C++ grammar in detail, like which category of grammars it falls in, etc. Any links pointing me in the right direction would be helpful.
By category, I meant
I want to make 10 asynchronous http requests at once and only process the results when all have completed and in a single callback function. I also do not want to block any threads using WaitAll (it is my understanding that WaitAll blocks until all are complete). I think I want to make a custom IAsyncResult which will handle multiple calls. Am I on the right track? Are there any good resources or examples out there that describe handling this?
When binding multiple variables value1 value2 value3 in the same text field, do I do this:
text="{some text value1 other text value2 and other text value3}"
or
text="some text {value1} other text {value2} and other text {value3}"
I noticed both work, but which is the right way to do it and will work all the time.
From wiki: In computing, just-in-time compilation (JIT), also known as dynamic translation, is a technique for improving the runtime performance of a computer program.
So I guess JVM has another compiler, not javac, that only compiles bytecode to machine code at runtime, while javac compiles sources to bytecode,is that right?
I am trying to implement something that is similar to a faceted search. My data is a series of objects and relationships. The idea is that you click an object (in this case "95 Theses" and then the possibly relationships are displayed, in this case "author" and clicking the relationship shows the object that matches the relationship, in this case "Martin Luther".
My clicking of objects and relationsips (predicates) works fine. What I need to do is allow users to click an object or relationship and have all those that extend from it removed.
This is what I thought of adding when a object or relationship 'tag' is clicked (every time I add another object or relationship I increment the global attribute called 'level'):
if($(".objHolder,. preHolder").filter("[level>'"+level+"']").filter("[holderId='"+holderId+"']").length)
{ $(".objHolder,. preHolder").filter("[level>'"+level+"']").filter("[holderId='"+holderId+"']").remove(); }
<table border="0" cellpadding="4" cellspacing="2">
<tbody><tr>
<td class="objHolder" objid="1" holderid="1" level="1">
<table border="0" cellpadding="4" cellspacing="2">
<tbody><tr class="objItemRow" objid="1" holderid="1" level="1">
<td class="objItem" objid="1" holderid="1" level="2" bgcolor="#eeeeee" nowrap="nowrap">95 Theses</td>
</tr></tbody>
</table></td>
<td><img src="images/right.jpg" alt="" height="10" width="16"></td>
<td class="preHolder" level="2" holderid="1">
<table border="0" cellpadding="4" cellspacing="2"><tbody>
<tr><td class="preItem" level="3" subid="1" preid="1" holderid="1" bgcolor="#eeeeee" nowrap="nowrap">author</td></tr>
</tbody></table></td>
<td><img src="images/right.jpg" alt="" height="10" width="16"></td>
<td class="objHolder" level="3" holderid="1">
<table border="0" cellpadding="4" cellspacing="2"><tbody><tr><td class="objItem" level="4" objid="3" holderid="1" bgcolor="#eeeeee" nowrap="nowrap">Martin Luther</td></tr></tbody></table>
</td>
</tr></tbody>
</table>
I'm deploying a small conversion tool on some systems, and want the users to be able to run it from the right click Open with menu. But I don't want to change the default program users have associated to this file type.
It is easy to associate a file extension/type to a program, but how to do it without changing the default program?
I want detailed explanations for bsd-socket options so that I can use them in the right manner. Can anybody please provide me some document or link from where I can refer?
Thanks,
Satinder Singh
[email protected]
I'm getting this error in CodeIgniter when trying to load the email library:
Can't use method return value in write context
It's happening on line 827 of Loader.php in [codeigniter root]/system/libraries/Loader.php
include_once($filepath);
where $filepath equals "/var/www/system/libraries/Email.php"
I called it like this in another php file:
$this->load->library('email');
where $this is the CodeIgniter instance.
According to the CodeIgniter email doc page, I'm doing it right. But it's not working...
Hi,
I have a small issue with jQuery on Safari (Mac OSX 10.6) - the page loads fine under Firefox (Mac) and Internet Explorer (Win) but has to be refreshed to work properly in Safari...
http://7souls.co.uk/store/index.php?dispatch=products.view&product_id=29788
If you hover over the image it is meant to show a magnified version to the right hand side - which works on the first page load on all browsers except Safari on the Mac.
You have to refresh the page to get it to work under safari.
Any Ideas,
MM
I have this file structure:
folderIWantStuffIn/
- old_stuff
Now I want to add some new stuff that is in a git repo. I'd like to be able to use git clone and git pull right in the directory and get this:
folderIWantStuffIn/
- old_stuff
- new_stuff
When I use git clone, I get this:
folderIWantStuffIn/
- old_stuff
- NewStuffFolder/
- new_stuff
Are there flags I can pass into git clone to get this behavior?
Hi all,
I am currently Developing application in MVC2
I have want to used mutiple form tags in My application
In My View
I have Created a table which has Delete option which i am doing through Post for Individual Delete so i have Create form tag for each button.
i also want user to give option to delete mutiple records so i am providing them with checkboxes.This form should have all the values of checkboxes and all.
so form gets render Like this
for Each delete button
<form action="/Home/MutipleDelete" method="post">
<input class="button " name="Compare" type="submit" value="Mutipledelete" style="margin-right:132px;" />
<input id="chk1" name="chk1" type="checkbox" value="true" />
<form action="/Home/Delete" method="post">
<input type="submit" class="submitLink" value="member1" />
<input type="hidden" name="hfmem1" id="hfmem1" value="1" />
</form>
<input id="chk2" name="chk2" type="checkbox" value="true" />
<form action="/Home/Delete" method="post">
<input type="submit" class="submitLink" value="member2" />
<input type="hidden" name="hfmem2" id="hfmem2" value="2" />
</form>
</form>
The following is not working . but IF i write my code that form renders in this way
<form action="/Home/MutipleDelete" method="post">
<input class="button " name="Compare" type="submit" value="Mutipledelete" style="margin-right:132px;" />
</form>
<input id="chk1" name="chk1" type="checkbox" value="true" />
<form action="/Home/Delete" method="post">
<input type="submit" class="submitLink" value="member1" />
<input type="hidden" name="hfmem1" id="hfmem1" value="1" />
</form>
<input id="chk2" name="chk2" type="checkbox" value="true" />
<form action="/Home/Delete" method="post">
<input type="submit" class="submitLink" value="member2" />
<input type="hidden" name="hfmem2" id="hfmem2" value="2" />
</form>
it is working in Mozilla but not in IE.I have debug and Checked values in formcollection In contoller.What to do.?
Hi,
I changed the file permissions on all my files and directories in my Joomla site and I am getting the 500 Internal Server error.
What should be the right file permissions settings.
Thanks
Hi!
I'm about to replace my oldfashioned sessionbased server solutions with RESTful ones.
Where can I find information about design principles concerning security, authentication etc. when moving into this stateless domain?
I need to find solutions that work with different client platforms (Flex/Air, Browser, desktop and mobile apps etc.). Right now I work with php in the server end.