Vote count: 0 I'm quite new to C# and still leaing, my apologies if this is a simple question. When a user orders an item(s), the items are assigned an OrderId which is then related to an Order using this OrderId. Now however I need to link both of these and display them so only the user ordering them can view them(Based on the Useame which is stored in Orders Class) How would I do this in my ViewOrdersController? asked 1 min agoAndre Queen Let's block ads!...
ادامه مطلبVote count: 0 Disclosure: I'm not a programmer, or trained in web design. Please forgive me if this is something stupid. Today I've been trying to fix a problem with overlapping Masonry on my Wordpress.org website, nathanhewitt.net. I found that the likely solution was to use imagesLoaded, a jquery script (imagesloaded.desandro.com). since this isn't my area of expertise, I didn't know how to use a jquery script so I went through many different forums, primarily using this and this as my guides ...
ادامه مطلبVote count: 0 If you're writing a conventional Python program, the most natural way of putting multiple function together into a single function-bundle to access them as bundle_name.function_name() is to locate them is a separate file and import it as a module every time you need them. Things are getting more complicated as you start using IPython notebook, because you are basically working in a single IPython session and there's no single clear solution for the problem of splitting the logic of...
ادامه مطلبVote count: 0 Here is what I've done so far: struct rep_list { struct node *head; struct node *tail; } typedef rep_list *list; int length(const list lst) { if (lst->head == NULL) { retu 0; } else { lst->head = lst->head->next; retu 1 + length(lst); } } This works, but the head of the list the function accepts as a parameter gets changed. I don't know how to fix that. I'm not allowed to change the function definition so it should always accept a list variable. Any ideas? asked 1 min agoRrmm Let's...
ادامه مطلبVote count: 0 Basically I have a User entity and that user will have followers. One possible way I could think of on how to model this is to have a multi-valued property of type Key, which will store Keys of the followers in a list. Like this.. DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); Entity userEntity; Key k = entity.getKey(); Entity user = new Entity("User"); List followers = new ArrayList(); followers.add(k); user.setProperty("FollowersList", followers); dat...
ادامه مطلبVote count: 0 Brief overview of the programme: When launching script, the dialog window is appearing and asking you to select directory path (class MyApp) When selected - one need to push "Start Monitoring" button. This action withdraw main window (root) and initialize container (class FrameContainer) consisting of two frames, namely 'PageOne' and 'PageTwo' (see corresponding classes). Button "Back Home" on "Page One" should destroy the instance of class FrameContainer and show again the dialog ...
ادامه مطلبVote count: 0 In certain styles of python, everything is a generator, e.g. uses yield rather than constructing and retuing a list. If you need to use it as a list, you can just call list(gen). If I have a list already, what is the cost of calling list(my_list)? Use: I have a variable that I know has an iterator and might be a list, but I need to use it as a list. Is it better/more pythonic to do my_list = list(my_list) or some other way of checking its list-ness? If it matters I'm using Python 3...
ادامه مطلبVote count: 0 I have a view pager with two tabs in my app (A and B). The first tab i.e A has a listview. Clicking on any of the items in the list opens a new fragment (let's call it C) with another list. The tab B also has a listview. The list in tab B and the list contained in the fragment C have the same type of items. That is each item of both list is of the same class. I have used a recycler view with a custom adapter to create the list. Since both lists in tab B and fragment c are of the sa...
ادامه مطلبVote count: 0 I am trying to find the maximum length of the last key-value pair in the list of ordered dictionary. Example: # below is the list of ordered dict my_list = [{'Table': 'Config', 'Column': 'config_id', 'DataType': 'int'}, {'Table': 'Config', 'Column': 'config_name', 'DataType': 'varchar'}, {'Table': 'Config', 'Column': 'config_value', 'DataType': 'numeric'}] # Expected out put Out put: 8 # as the key (in this case "DataType") has max chars and if any value for the same key has max ch...
ادامه مطلبVote count: 0 I am getting a list of items in a JSON(through AJAX) and creating the required markup by JS and appending in the view. On the other hand I have seen few examples which do not use this practice, and send the complete or partially complete markup through AJAX and then simply append them to the document. So definitely the markup is being generated on the server. So I am curious which one is the better approach and why. One thing I can clearly see is that the later approach does not ex...
ادامه مطلبVote count: 0 How do I get a list of files that have been removed or added? I'd like to compare my current branch against the version of the files in origin's master to see what's new. asked 1 min agoragerdl 1 Answer Vote count: 0 git diff ..origin/master --summary | grep "create" | awk '{ print $4 }' git diff ..origin/master --summary | grep "delete" | awk '{ print $4 }' git ls-files may also be useful. answered 1 min agoragerdl Let's block ads!...
ادامه مطلبVote count: -2 I am using a HashMap, its key is a string and values are list of strings. The output of the map is 68 [BREAKFAST_ENTREE, 15, 1, 33, 1, 3755, 1, 80014000, 1, 83058000, 1] or 38 [BREAKFAST_DRINK, 80606002, 1, 3988, 1, 40000042, 1]. where 68 is string key and rest are list of strings. How can I get the count of values corresponding to each key. for eg : 68 has 11 values in it. If any one can help, that will be very useful. asked 27 secs agoSurya Joseph Let's block ads!...
ادامه مطلبVote count: 0 I am new to python . I am currently creating a GUI which is having 4 options. It means one question and respective 4 choices. User will select 1 choice and when click on OK, it will show a custom Dialog and tell you whether answer is correct or not import wx class MyFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "My Frame", size=(3000, 3000)) panel = wx.Panel(self,-1) #panel.Bind(wx.EVT_MOTION, self.OnMove) wx.StaticText(panel, -1, "What are the values of X"...
ادامه مطلبVote count: 0 I use GCM and when notifications comes I want to make some special things. So, I need something like onClickListener on the Notification. Any idea ? Here is my code: Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent, PendingIntent.FLAG_ONE_SHOT); Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Notific...
ادامه مطلبVote count: -1 I'm having a singleton class, I need to assign datatable values to singleton class of list and store that as session class singletionfunctioame { // Something here } please guide me on this. edited just nowun-lucky asked 2 mins agoSindhu Let's block ads!...
ادامه مطلبVote count: 1 I am making a neural network based OCR software in python. I am using a pretrained language model, and a dataset from the Inteet for the OCR neural network. I need to specify the charset to make the neural network works, and I am extracting the charset from the dataset reading UTF-8 encoded text file.However, the dataset documents says (the dataset and the pretrained model is made by another person) the number of the charset is 3877, but when I scan all of the file and remove the o...
ادامه مطلبVote count: 0 I`m writing on C++/CLI (Managed C++) in VS2015 IDE. I need to scan every folder, which is currently opened in Explorer, to find there files by needed patte. But first of all, is it possible and if it is, then how it can be done? I found this one: Search result, but it seems thai it is only for winapi, because i couldn`t even find such reference in VS2015. Advance thanks. asked 1 min agomib007 Let's block ads!...
ادامه مطلبVote count: 0 I extended Python with C modules with SWIG. Is it possible to profile C - modules from Python ? (It is very important to display runtime) asked 1 min agoAGazizov Let's block ads!...
ادامه مطلبVote count: 0 I have 6 arrays, let's say a,b,c1,d1,c2,d2. Arrays a and b have some common pairs of c1,c2 and d1,d2. I find these common pairs, i.e. those a and b which have the same c1,d1 and c2,d2 like this: data_zcosmo_lastz = a data_zphot_lastz = b halo_id_zcosmo = c1 halo_id_zphot = c2 idrep_zcosmo = d1 idrep_zphot = d2 file2freq1 = Counter(zip(c1,d1)) file2freq2 = Counter(zip(c2,d2)) set_a = set(file2freq1) & set(file2freq2) # common objects The above code gives set_a to have those common v...
ادامه مطلبVote count: 1 I am building a C# application for a law firm. In every Form there are some Controls which only some of the users can access (for other users - those Controls will be disabled). I have built it like this: There is a class called AuthorizedForm that inherits from Form. This class has a method called SetAuthorization, which enables all the Controls the user may access, and disables the rest. Each form in the application inherits from AuthorizedForm. When the user logs in, the SetAuth...
ادامه مطلب